Want to level up your skills and unlock the power of Databases?
Tags: programming, database, devjournal, backend
Published: 2023-03-01 02:21:00


![Introduction to Databases](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lok48dkpxs58pbio5xeo.png)

Vedika, a fresh CS graduate, decided to build a Digital Music Store. She chose to store Music Artists and Album details in CSV files. She was happy with how quickly she could implement the solution. But she was in for a surprise.


![Sample database representing music artists and album details](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/a9oqfwagj2br0qby5djk.png)


She soon realised this was not a maintainable solution. She had to update her code whenever she needed to create, read, edit, or delete a record. With the data becoming too large and complex, she realised the solution was insufficient.


**Her solution had Data Integrity Problems:** 
-How do we ensure the artist is the same for each album entry?
-What if somebody overwrites the album year with an invalid string?
-How do we treat multiple artists on one album?
-What happens when we delete an artist with an album?


**There were Implementation Problems:**
-How do we find a particular record?
-What if we want to create a new app in a different language using the same database?
-What if two threads try to write to the same file simultaneously?


**There were Durability Problems:**
-What if the machine crashes while our program is updating a record?
-What if we want to replicate the database on multiple machines for high availability?


She came across a mentor who introduced her to concepts of:
**_Database_** - an organised collection of inter-related data designed to represent different aspects of the real world around us
**_DBMS_** - a software that enables quick and accurate retrieval of data


**_A general-purpose DBMS_** is designed to solve these problems and allow developers to reliably create, find, update, and delete records following some Data Model.
**_A Data Model_** is a collection of concepts for describing the data in the database.



![Kinds of Data Model](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/rdcb4p73riocvwm2yf0f.png)



**_A Data Model_** entails two layers to enable interaction with the data:
-**_A Logical Layer_** describes entities and attributes the database has.
-**_A Physical Layer_** describes how those entities and attributes are stored on a disk.
-In 1960s, there was a tight coupling between them.


Ted Codd, a mathematician at IBM Research, noticed that a simple Schema change led to changes in disk storage (physical layer), forcing them to rewrite DBMS every time (logical layer). So in 1970, he proposed the Relational Model to avoid this. 


![Tedd Codd and his research](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xptd21p3yp7xmycyw14u.png)



The Relational Model defines a Database abstraction based on relations to avoid maintenance overhead. It has three key points: 
-Store database in simple data structures
-Access data through a high-level language
-Physical storage is left up to the DBMS implementation 




These revelations left Vedika in complete awe of DBMS. As a curious developer, she decided to dive headfirst into the rabbit hole and thoroughly learn about databases. 


Thanks for reading this.

To follow along her journey, [follow me](https://dev.to/pragyanatvade).

If you have an idea and want to build your product around it, schedule a call with [me](https://calendly.com/pragyanatvade).

If you want to connect, reach out to me on [Twitter](https://twitter.com/pragyanatvade) and [LinkedIn](https://www.linkedin.com/in/pragyanatvade/).