Data Storage and Querying in DBMS
Last Updated : 24 Jul, 2024
Database Management System is the collection of interrelated data/information or a set of programs that manages controls, and accesses the use of data. Through DBMS, users can manage the data efficiently in a database to increase accessibility and productivity. For example - Employee records and telephone Books have all the different contacts saved in a single place very efficiently.
So, a Database System is a software system, having an organized collection of structured information, stored in a computer system. It enables the user to create, maintain, define, and control access to the database.
Uses of DBMS
- To increase productivity through real-time component data.
- For Reducing the data redundancy and inconsistency.
- To enhance the data integrity.
- For Retrieving the data.
- For Data Security.
- For Data Indexing.
For more details, you can read the article Application of DBMS.
The Database System is further divided into two components. They are as follows:
- Data Storage Manager
- Query Manager
Data Storage Manager
Data Storage Manager also known as "Database Control System", is generally a program that provides an interface between the data/information stored and the queries received. It helps us to maintain the integrity and consistency of the database by applying the constraints. It is a highly flexible and scalable product that provides us with the capability of fully managed storage.
Storage Manager is generally in charge of the interactions with the File Manager, where raw data is stored on the data with the help of the file system. It translates various DML statements into low-level commands.
- Authorization and Integrity Manager: The main purpose of the Authorization and Integrity Manager is to ensure the satisfaction of the integrity constraints and checks the authority of users to access information.
- Transaction Manager: The main purpose of Transaction Manager is to ensure that even after the system failures, the database should remain in a uniform state.
- File Manager: The main purpose of File Manager is to manage the allocation of space on the disk storage.
- Buffer Manager: The main purpose of Buffer Manager is to fetch the data from disk storage into the main memory. The buffer manager is a critical part of the database system since it enables the database to handle data sizes that are much larger than the size of the main memory.
The storage manager implements several data structures as part of the physical system implementation:
- Data files, which store the database itself.
- Data dictionary, which stores metadata about the structure of the database, in particular the schema of the database.
- Indices, which can provide fast access to data items. Like the index in this textbook, a database index provides pointers to those data items that hold a particular value. For example, we could use an index to find the instructor record with a particular ID, or all instructor records with a particular name. Hashing is an alternative to indexing that is faster in some but not all cases.
Query Processor
Query Processor contains the following three components:
- DDL Interpreter: The DDL Interpreter is the Data Definition Language Interpreter which is used to build and modify the structure of your tables and other objects in the table. DDL interpreter, which interprets DDL statements and records the definitions in the data dictionary.
- DML Compiler: DML Compiler is the Data Manipulation Language which is used for adding (inserting), deleting, and modifying (updating) data in a database. or we can say translating the DML statements into query language consists of low-level instructions that only query engines can understand. A query can usually be translated into any of a number of alternative evaluation plans that all give the same result. The DML compiler also performs query optimization; that is, it picks the lowest cost evaluation plan from among the alternatives.
- Query Evaluation Engine: It executes the low-level language instructions, generated by DML Compiler.
Conclusion
In Conclusion, maintaining and obtaining valuable information from massive datasets depends on efficient data storage and querying in DBMS. A strong database system is successfully implemented and maintained with careful attention to data integrity and security, scalability concerns, query optimization, and suitable storage structure design.