Database Manager

It is the interface between low-level data, application programs and queries. A database manager is a program module responsible for interfacing with the database file system to the user queries. It enforces constraints to maintain the consistency and integrity of the data as well as its security. It synchronizes the simultaneous operations performed by concurrent users. It also performs backup and recovery operations.

Components of Database Manager:
  • Authorization Control - Checks that the user has necessary authorization to carry out the required function.
  • Command Processor - Converts commands to a logical sequence of steps.
  • Integrity Checker - Checks the requested operation satisfies all necessary integrity constraints such as key constraints.
  • Query Optimizer - Examines the query language statements and tries to choose the best and most efficient way to executing the query. Factors CPU time, disk time, network time, sorting methods and scanning methods.
  • Transaction Manager - The transaction manager maintains tables of authorization concurrency.
  • Scheduler - It controls the relative order in which transaction operations are executed. This module is responsible for ensuring that concurrent operations or transactions on the database proceed without conflicting with one another. A database may also support concurrency control tables to prevent conflicts when simultaneous, conflicting commands are executed.
  • Recovery Manager - Ensures that the database remains in a consistent state in the presence of failures. It is responsible for transaction commit and abort, that is success or failure of transaction.
  • Buffer Manager (Cache Manager) - Responsible for the transfer of data between main memory and secondary storage.

Important responsibilities of Database Manager:
  • Interaction with File Manager - The raw data is stored on the disk using the file system which is usually provided by a conventional operating system. The database manager translates the various DML statements into low-level file system commands. Thus, the database manager is responsible for the actual storing, retrieving and updating of data in the database.
  • Integrity Enforcement - The data values stored in the database must satisfy certain types of consistency constraints. These constraints must be specified explicitly by the DBA. If such constraints are specified, then the database manager can check whether updates to the database result in the violation of any of these constraints and if so appropriate action may be imposed.
  • Security Enforcement - Not every user of the database needs to have access to the entire content of the database. It is the job of the database manager to enforce these security requirements.
  • Backup and Recovery - It is the responsibility of database manager to detect system failures due to disk crash, power failure, software errors, etc and restore the database to a state that existed prior to the occurrence of the failure. This is usually accomplished through the backup and recovery procedures.
  • Concurrency Control - When several users update the database concurrently, the consistency of data may no longer be preserved. It is necessary for the system to control the interaction among the concurrent users, and achieving such a control is one of the responsibilities of database manager.
Database Management System
Query Processor:
The query language processor is responsible for receiving query language statements and changing them from the English like syntax of the query language to a form the DBMS can understand.
It consists of two separate parts:
  • The parser
  • The query optimizer
The parser receives query language statements from application programs or command-line utilities and examines the syntax of the statements to ensure they are correct. To do this, the parser breaks a statement down into basic units of syntax and examines them to make sure each statement consists of the proper component parts. If the statements follow the syntax rules, the tokens are passed to the query optimizer.

The query optimizer examines the query language statements, and tries to choose the best and most efficient way of executing the query. To do this, the query optimizer will generate several query plans in which operations are performed in different orders, and then try to estimate which plan will execute most efficiently. When making this estimate, the query optimizer may examine factors such as: CPU time, disk time, network time, sorting methods, and scanning methods.