DBS Component Modules
Depiction and Working Principle of DBS Component Modules
The component modules of a Database System (DBS) are generally divided into two main parts:
User Interaction Layer
This part refers to various types of users and their interfaces with the database system:DBA Staff: Define and control the structure of the database using Data Definition Language (DDL) and administrative commands.
Casual Users: Use ad-hoc queries to retrieve data using interactive interfaces.
Application Programmers: Develop software programs that interact with the database.
Parametric Users: Execute predefined or canned transactions (e.g., ATM users, point-of-sale staff).
Internal System Components
This part manages data storage and transaction processing within the system.
Working Principle of DBS Component Modules
Compilation of Commands
DDL Compiler: Processes DDL commands and stores the resulting schema definitions and design metadata in the System Catalog.
Query Compiler and Optimizer: Processes user queries and sends them to the Query Optimizer, which chooses the most efficient query execution plan.
Pre-compiler and DML Compiler: Convert application programs and DML statements into a format the system can execute.
System Catalog / Data Dictionary / Stored Database
The System Catalog (also known as the Data Dictionary) stores all metadata, such as schema definitions, file names, data types, integrity constraints, and access paths.
It is used by various components during query processing, optimization, and execution.
The Stored Data Manager handles reading from and writing to disk storage.
Actual user data is kept in the Stored Database on disk.
Query and Transaction Execution
The Runtime Database Processor is responsible for executing the compiled and optimized queries and transactions.
It interacts with the stored data to perform required operations and refers to the system catalog for metadata and constraints.
The final output is returned to the user or the calling application.
Summary of Working Flow
A user enters a query or initiates a database program.
The DBMS compiles the input to check for syntax and logical errors and converts it into an internal format.
The compiled query is passed to the optimizer to determine the most efficient execution strategy.
The Runtime Database Processor executes the optimized query or transaction.
During execution, it interacts with the Stored Database and may access metadata from the System Catalog.
The processed results are sent back to the user or application.
DBMS Component Modules
A Database Management System (DBMS) consists of several integrated components (modules) that handle various aspects of database definition, processing, and management. These modules interact with both the database and the DBMS catalog, which are typically stored on disk.
The DBMS is composed of several cooperating components:
DDL compiler for schema processing
Catalog manager for metadata storage
Query compiler and optimizer for parsing and improving query performance
Runtime database processor for executing transactions and queries
Buffer and data managers for storage and memory efficiency
Transaction management for reliability and concurrency
1. Storage and Buffer Management
The database and the DBMS catalog (which stores metadata) reside on disk storage.
Access to the disk is primarily controlled by the operating system (OS), which schedules low-level read/write operations.
However, many DBMSs include their own buffer management module to improve performance by managing data transfers between disk and main memory.
Effective buffer management reduces the number of disk I/O operations, which are often the slowest part of database processing.
A higher-level module, the stored data manager, controls access to all data stored on disk, whether it belongs to the user database or the DBMS catalog.
2. DDL Compiler and Catalog Management
The Data Definition Language (DDL) compiler processes schema definitions written in DDL and stores the resulting metadata in the DBMS catalog.
The catalog includes information such as:
- File names and sizes
- Data types and names of attributes
- File storage structures and access methods
- Schema mapping information
- Data integrity constraints
The catalog also stores internal statistics and metadata used by other DBMS modules, including the query optimizer and transaction manager.
3. Query Processing Modules
a. Interactive Query Interface
Used by casual users or those with occasional data access needs.
Accepts user-submitted queries through a graphical interface or command-line interface.
b. Query Compiler
Parses and validates queries submitted through the interface.
Checks for correct syntax, the validity of table names, attributes, and data types.
Transforms the query into an internal representation suitable for optimization and execution.
c. Query Optimizer
Optimizes the internal query representation by:
Reordering operations
Eliminating redundancies
Choosing the most efficient algorithms and access paths
Uses statistical and structural information from the DBMS catalog to make optimization decisions.
Outputs an executable query plan, which is passed to the runtime database processor.
4. Runtime Database Processor
Executes the following:
Privileged commands (e.g., schema changes)
Optimized query plans
Predefined transactions (also called "canned transactions") with runtime parameters
Collaborates with:
The system catalog to retrieve metadata and update statistics
The stored data manager for accessing disk-stored data
The buffer manager for managing memory-resident data blocks
May rely on the OS for low-level I/O, or implement custom I/O handling for better control and performance.
5. Transaction Management
Includes modules for:
Concurrency control: Ensures correct execution of simultaneous transactions without conflicts.
Backup and recovery: Protects the database against system failures and allows data restoration.
These components are closely integrated with the runtime database processor to provide full ACID (Atomicity, Consistency, Isolation, Durability) transaction properties.