Structure of DBMS
The Structure of DBMS is divided into several components which perform specific functions such as Query processing, storage management, etc. Each of these components is sub-divided into other components to execute different operations like DDL interpretation, DML compilation, etc. There are three major components of the structure of DBMS Query Processor, Storage Manager, and Disk Storage. Every component more or less depends on the other component for its proper functioning. Let us dive deep into the structure of DBMS.
Introduction to Structure of DBMS
Database Management System (or DBMS) acts as an interface between users and the Database to retrieve and update data. As the name suggests, it is a system used for managing the database. As in the real world, to perform any complex operation, its structure is divided into several parts(or components) to make it simpler like before constructing an apartment, its structure is generated which consists of several components such as developing the base followed by construction then painting and all.
In the same way, Database Management is done on the basis of a particular structure which is divided into several components where each component is responsible for performing a particular task like Query Processor is responsible for processing the queries given by the end-user. Let us discuss these components in detail.
Components of DBMS Structure
The structure of DBMS is divided into three components namely "Query Processor", "Storage Manager", and "Disk Storage". Each of these components plays a very crucial role in Database Management. Hence we will see all three of them with a due concentration on detail. Before moving into details let us have a quick overview of the structure of DBMS. Here we go,
- Query Processor
- DML Compiler
- DDL Interpreter
- Embedded DML Pre-compiler
- Query Evaluation Engine
- Storage Manager
- Authorization and Integrity Manager
- Transaction Manager
- File Manager
- Buffer Manager
- Disk Storage
- Data Files
- Data Dictionary
- Statistical Data
Let us now see what is the task of each of these components and their sub-components respectively. We will start with the first one which is the "Query Processor".
1. Query Processor
Query processor as the name suggests handles the query processing. In simple words, it processes the query given by the user. This is how the Query Processor helps the database system in simplifying and facilitating access to data. The main function of the query processor is executing the query without any failure. But how does it works? The Query Processor converts (or interprets) the queries given by the user through the application program into machine-readable instructions. It is also responsible for executing the user requests that are received from the DML compiler. Let us now see the components of query processor and their functions(what tasks they perform). Let us now discuss the components of the Query Processor. DDL Interpreter DDL expands to Data Definition Language. DDL Interpreter as the name suggests interprets the DDL statements such as schema definition statements like create, delete, etc. The result of this interpretation is a set of a table that contains the meta-data which is stored in the data dictionary. Data dictionary is capable of storing the meta-deta. Its basically a component of Disk Storage that we will discuss later in this article. DML Compiler DML expands to Data Manipulation Language in DBMS. DML Compiler again as the name suggests compiles(or translates) the DML statements such as select, update and delete statements into low-level instructions which is nothing but the machine-readable object code to make it executable. The DML compiler is also responsible for query optimization. Why? Because usually there are several evaluation plans in which a single query is translatable. Hence, some optimization is required to pick the lowest cost evaluation plan from all the available plans. This is called query optimization in DBMS which is performed by the DML compiler only. In simple words, the most efficient way of executing a query is determined by Query optimization. Embedded DML Pre-compiler The DML statements in the application program which are embedded(such as SELECT, FROM, etc. in SQL) needs to be pre-compiled into normal procedural calls(program statements that the host language can understand) before the query evaluation. So, Embedded DML Pre-compiler is responsible for processing the DML statements that are embedded in an application program into procedural calls. Query Evaluation Engine The Query Evaluation Engine is also referred as "Query execution engine". First it takes the query evaluation plan, then execute it and return the answer back to the query. In simple words, Query Evaluation Engine first interprets the SQL commmands to access the data from the database and then it returns the answer to that query. In short, it is responsible for evaluating the queries and executing the object code that was generated by DML Compiler. Some of the examples of Query Evaluation Engine are Apache drill, Presto, etc.
2. Storage Manager
Lets assume, there is the data stored in the database and there are some queries received from the end-user. But how these two things would interact with each other? here comes the term "Storage Manager". It is nothing but a program that acts as an interface between the data which is stored in the database and the end-user queries.
It is the Storage Manager which ultimately interacts with the file manager. Storage Manager also executes the DCL statements such as GRANT and REVOKE. Hence we can say that it is the storage Manager that is responsible for storing, retrieving, updating, or deleting the data present in the database and then the file is updated accordingly.
Apart from this, Storage Manager is also called "Database Control System" as it is also responsible for maintaining the consistency and integrity of the database.
Let us now discuss the components of Storage Manager. Authorization and Integrity Manager There can be some data in the database that needs to be accessed by authorized individuals only and should be hidden from the public users and sometimes integrity constraints are needed to be checked at the time of database modification. This is where Authorization and Integrity Manager comes into play. The Authorization and Integrity Manager verifies the authority of the user trying the access the data and it also checks the integrity constraints when the database is modified. The data can be modified only if the result of the constraint comes out to be True, else the data remains unmodified. Hence, integrity constraints are very helpful in preventing any accidental damage to the database.
Transaction Manager A transaction in DBMS is nothing but a very small unit of the program. The Transaction Manager as the name suggests manages all the transaction(program) execution. To be precise, it ensures the consistent state of the database in spite of system failures. It is also responsible for ensuring that the concurrent execution of transactions happens without any conflicts which results in flawless transactions. File Manager The task of the file manager is to manage the space allocation in disk for storing the information and also the data structures used for representing that information. We will discuss disk storage in detail later in this article in the "Disk Storage" section. Buffer Manager The Buffer Manager allocates the space to the buffer to store data in it. It also fetches the data from the disk storage to the main memory and is responsible for deciding what data to cache in memory. By doing so, Buffer Manager manages the space allocation for buffer using various methods such as Buffer Replacement Strategy(with LRU). This ultimately results in minimum number of transfers between disk and memory as buffer stores the data in memory which eventually fulfills the goal of DBMS.
3. Disk Storage
The Storage Manager* is responsible for implementing the below given data structures as a part of the physical system implementation. This simply means that these data structures are implemented during the physical system implementation. Data Files It is responsible for storing the database. Data Dictionary The Data Dictionary stores the information(or meta-data) about the definition of a database. In simple words, it stores the database structure information(the schema of the database). Indices Indices (plural of an index) help in retrieving the data items in a much faster way. Statistical Data Statistical Data as the word suggests stores the statistical information regarding the data stored in the database. Query processor utilizes this statistical information for selecting a much more efficient way to execute a query.
So this is how the whole structure of DBMS looks like. Hope this article has helped you in some way. Don't forget to read the conclusion of the article.
- There are three major components of the structure of DBMS.
- These components are Query Processor, Storage Manager, and Disk Storage.
- Query Processor helps the database system in simplifying and facilitating access to data.
- The main function of the query processor is executing the query without any failure.
- Storage Manager is responsible for storing, retrieving, updating, or deleting the data sitting in the database.
- Disk Storage contains Data Files, Data Dictionary, Indices, and Statistical Data and helps to access the data stored in the disk.