TOPIC III_Database Architecture
TOPIC III_Database Architecture
The architecture of a database system is greatly influenced by the underlying computer system on
which the database system runs. Database systems can be centralized, or client-server, where one
server machine executes work on behalf of multiple client machines. Database systems can also be
designed to exploit parallel computer architectures. Distributed databases span multiple geographically
separated machines.
A database system is partitioned into modules that deal with each of the responsibilities of the overall
system. The functional components of a database system can be broadly divided into the storage
manager and the query processor components. The storage manager is important because
databases typically require a large amount of storage space. The query processor is important because
it helps the database system simplify and facilitate access to data.
It is the job of the database system to translate updates and queries written in a nonprocedural
language, at the logical level, into an efficient sequence of operations at the physical level.
Database applications are usually partitioned into two or three parts, as in Figure 1.4. In a two -tier
architecture, the application resides at the client machine, where it invokes database system
functionality at the server machine through query language statements. Application program interface
standards like ODBC and JDBC are used for interaction between the client and the server. In contrast,
in a three -tier architecture, the client machine acts as merely a front end and does not contain any
direct database calls. Instead, the client end communicates with an application server, usually through a
forms interface.17
The application server in turn communicates with a database system to access data. The business logic
of the application, which says what actions to carry out under what conditions, is embedded in the
application server, instead of being distributed across multiple clients. Three-tier applications are more
appropriate for large applications, and for applications that run on the WorldWideWeb.
Query Processor:
The query processor components include
· DDL interpreter, which interprets DDL statements and records the definitions in the data dictionary.
· DML compiler, which translates DML statements in a query language into an evaluation plan
consisting of low-level instructions that the query evaluation engine understands.
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, which executes low-level instructions generated by the DML compiler.
Storage Manager:
A storage manager is a program module that provides the interface between the low-level data stored in
the database and the application programs and queries submitted to the system. The storage
manager is responsible for the interaction with the file manager. The raw data are stored on the disk using
the file system, which is usually provided by a conventional operating system. The storage manager
translates the various DML statements into low-level file-system commands. Thus, the storage manager is
responsible for storing, retrieving, and updating data in the database.
The storage manager components include:
Authorization and integrity manager, which tests for the satisfaction of integrity constraints and
checks the authority of users to access data.
Transaction manager, which ensures that the database remains in a consistent (correct) state
despite system failures, and that concurrent transaction executions proceed without conflicting.
File manager, which manages the allocation of space on disk storage and the data structures
used to represent information stored on disk.
Buffer manager, which is responsible for fetching data from disk storage into main memory, and
deciding what data to cache in 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
main memory.
Transaction Manager:
A transaction is a collection of operations that performs a single logical function in a database
application. Each transaction is a unit of both atomicity and consistency. Thus, we require that
transactions do not violate any database-consistency constraints. That is, if the database was
consistent when a transaction started, the database must be consistent when the transaction
successfully terminates. Transaction - manager ensures that the database remains in a consistent
(correct) state despite system failures (e.g., power failures and operating system crashes) and
transaction failures.
Summary of the elements of DBMS:
DML pre-compiler:
It converts DML statement embedded in an application program to normal procedure calls in the host
language. The pre-complier must interact with the query processor in order to generate the appropriate
code.
DDL compiler:
The DDL compiler converts the data definition statements into a set of tables. These tables contain
information concerning the database and are in a form that can be used by other components of the
DBMS.
File manager:
File manager manages the allocation of space on disk storage and the data structure used to
represent information stored on disk.
Database manager:
A database manager is a program module which provides the interface between the low level data
stored in the database and the application programs and queries submitted to the system.
The responsibilities of database manager are:
1. Interaction with file manager: The data is stored on the disk using the file system which is provided
by operating system. The database manager translate he the different DML statements into low-level
file system commands. So the database manager is responsible for the actual storing, retrieving and
updating of data in the database.
2. Integrity enforcement: The data values stored in the database must satisfy certain constraints (eg:
the age of a person can't be less than zero).These constraints are specified by DBA. Data manager
checks the constraints and if it satisfies then it stores the data in the database.
3. Security enforcement: Data manager checks the security measures for database from
unauthorized users.
4. Backup and recovery: Database manager detects the failures occurs due to different causes (like
disk failure, power failure, deadlock, s/w error) and restores the database to original state of the
database.
5. Concurrency control: When several users access the same database file simultaneously, there
may be possibilities of data inconsistency. It is responsible of database manager to control the
problems occurs for concurrent transactions.
Query processor:
The query processor used to interpret to online user’s query and convert it into an efficient series of
operations in a form capable of being sent to the data manager for execution. The query processor
uses the data dictionary to find the details of data file and using this information it create query
plan/access plan to execute the query.
Data Dictionary:
Data dictionary is the table which contains the information about database objects. It contains
information like
1. External, conceptual and internal database description
2. Description of entities, attributes as well as meaning of data elements
3. Synonyms, authorization and security codes
4. Database authorization
The data stored in the data dictionary is called meta data.