The database system is organized into different modules, each responsible for specific functions. Some functions, like file systems, might be handled by the operating system itself. The database system is mainly divided into two key components:
1.Query Processor
2.Storage Manager
The query processor is responsible for simplifying and facilitating access to data within the database. Its primary role is to execute queries effectively. It does this by interpreting user requests received via an application program and converting them into executable instructions.
Components of the Query Processor:
1.DDL Interpreter
⇒ This component interprets Data Definition Language (DDL) statements (like schema definitions) and converts them into a set of tables containing metadata, which is stored in a data dictionary.
2.DML Compiler
⇒ It translates Data Manipulation Language (DML) statements (like SELECT, INSERT, UPDATE, DELETE) into low-level instructions (object code) that can be executed.
⇒ The DML compiler also performs query optimization, selecting the most efficient way to execute a query from among various possible plans.
3.Embedded DML Pre-compiler
⇒ It processes DML statements embedded within an application program and converts them into procedural calls.
4.Query Evaluation Engine
⇒ This engine executes the low-level instructions generated by the DML Compiler.
The storage manager is the interface between the data stored in the database and the queries received from the query processor. It is responsible for:
⇒ Interacting with the file manager to store and retrieve data from the disk.
⇒ Translating DML statements into low-level file-system commands.
⇒ Updating, storing, deleting, and retrieving data in the database.
⇒ Maintaining consistency and integrity by applying constraints and executing Data Control Language (DCL) statements.
Components of the Storage Manager:
1.Authorization Manager and Integrity Manager
⇒ It checks user permissions and ensures that data modifications adhere to integrity constraints.
2.Transaction Manager
⇒ It ensures the database remains consistent and correct even in the event of system failures and that concurrent transactions do not conflict with each other.
3.File Manager
⇒ It manages the allocation of disk space and the data structures used to store information on disk.
4.Buffer Manager
⇒ It fetches data from disk storage into main memory and decides which data to keep in main memory for efficient access.
The Storage Manager implements several data structures as part of the physical system:
1.Data Files
⇒ These files store the actual database.
2.Indices
⇒ Indices are used to quickly locate and retrieve data.
3.Data Dictionary
⇒ It contains metadata about the database, such as its schema and structure.
4.Statistical Data
⇒ This includes statistical information about the data in the database, which the query processor uses to select efficient ways to execute queries.