Data Abstraction in DBMS
Database systems, characterized by intricate data structures, employ abstraction to enhance efficiency in data retrieval and simplify user interaction. Abstraction involves concealing irrelevant details, and streamlining database design for improved usability. This article delves into data abstraction in Database Management Systems (DBMS). In DBMS, data abstraction entails shielding end-users from unnecessary data. For instance, when buying shoes, a customer specifies preferences like company, size, color, and material, while details about manufacturing, material source, and cost remain hidden. This selective presentation, known as data abstraction, optimizes user focus on essential information, enhancing the overall user experience in database interactions.
Levels of Data Abstraction in DBMS
The data abstraction in DBMS is implemented in 3 layers:
- Physical or Internal Level
- Logical or Conceptual Level
- View or External Level
The following diagram will give you a clear view of how the implementation is done.
Starting from the very bottom, we have the physical or internal layer, then we have the middle layer, the logical or conceptual layer, and finally, we have the view or external layer.
Let us discuss each of these three layers in detail.
Physical Level or Internal Level
This is the layer of data abstraction where the raw data is physically stored as files. This layer contains all the complex data structures and the data accessing methods defined. The physical layer is the lowest level of data abstraction in a DBMS. It is the database administrator who decides how the data is to be stored in these physical hard drives.
Example:
When we access data we may get a single data or a table of data. Moreover, by the term "relational database" we visualize a table of rows and columns. But at a physical level, these tables are stored in hard drives which are located at a very secure data center.
Above is the picture of a Google data center that can be visited by only 1% of Googlers! All these racks contain hard disk drives storing all your secured data!
Logical Level or Conceptual Level
After taking the raw data from the physical or internal level, the structure of the data is defined at the logical or conceptual level. This is like a blueprint of the raw data. This layer does not have any information about how the end user will view the data.
Example:
We have data of a few products like product id, product name, and manufacturing date, and we have another set of data of customers containing customer id, customer name, and customer address. Now, we need to frame this data in proper tables of products and customers. After that, we can even frame a join to show which product has been ordered by which customer.
View Level or External Level
This is what an end-user gets to see. He/she does not get the entire database, but depending on the queries made from the front-end the user gets to see the data. It may be a single data from the entire database or a collection of data in tabular format. Multiple views of the same data are available to the user, the representation can be a table, a graph, or a pie chart. View Level is the highest level of data abstraction in DBMS.
Example:
Concerning the example in the logical level section, let us say a customer wants to view the order history, he gets to see only the orders he had made in the past. Now, let us say a shop owner needs to see the products that are on the order list. He gets to see a table containing all the info about the products and the customers to whom they need to be delivered.
Conclusion
- Data abstraction in DBMS means hiding unnecessary background details from the end user to make the accessing of data easy and secure.
- In DBMS, there are 3 levels of data abstraction:
- Physical Level or Internal Level: This is the layer where the raw data is stored in file format on physical hard drives.
- Logical Level or Conceptual Level: In this layer, the raw data is taken from the physical layer and organized in a proper structure, like in tabular format.
- View Level or External Level: At this level, the end users get the data depending on the queries. The same data can be viewed in multiple ways, like tables, graphs, or pie charts.