coderVishal
coderVishal

Reputation: 9109

Data Structures and Databases

I recently completed a course Algorithms part I and hence learned a lot of data structures that are used to store data in appropriate ways.

I realize that today for maintaining data we use data bases rather than writing data structures. We cant change these data structures used by the data base(Or can we). So when we go for permanent storage do we always go for database use(wont that hit performance), or is their a way in which both of them are used in a combination?

Upvotes: 0

Views: 766

Answers (2)

tempusfugit
tempusfugit

Reputation: 437

Data structures that you learnt ( I suppose), like List, Maps, Trees etc. are the core concepts of the modern Relational databases.

For example:

  1. B-tree is used in many databases. The B+-tree is used in many well known databases as well as common filesystems like NTFS.
  2. SQLite uses B+ tree
  3. SQL Server uses heap or B-tree

Majority of databases use a combination of these data structures, sometimes implementing a customized version. These are optimized for high performance.

For permanent storage, you can use a file system with manually implementing any data structure of your choice, but that would be like re-inventing the wheel

Upvotes: 1

Am_I_Helpful
Am_I_Helpful

Reputation: 19168

Databases are themselves comprehensibly designed to perform efficiently in all possible conditions. These databases are used only to store compact and vast data. If one has simpler,lesser and minimal needs to store and save data like that of a small program,these smaller data-structures would work easily on a flat-file system.

Also,I feel you are trying to compare flat-file-storage which utilises data structures and which are directly visible to the user WHEREAS in the case of database you can't say about their implemented data-structures to save the file and perform the data-manipulation operations as they are not visible to the user!

But,databases themselves perform hashing,indexing and other data-structures to implement their data storage techniques. They are efficiently coded as per internal data-structures that we generally don't find externally data-structure from the front-view. BUT,THEY DO IMPLEMENT THEIR DATABASES ON THE SAME TECHNIQUE!

Upvotes: 2

Related Questions