Database Architecture
Database Architecture
Also included as Components of database management or database structure.
A database system is partitioned into modules that deal with each of the
responsibilities of the overall system.
Functional components of a database system can be broadly divided into,
o Storage Manager
o Query Processor
Database Architecture / System Structure
1. Disk Storage
All data or information stored in disk storage
Various components of disk storage
o Data Data files which stores the database itself
o Data directory
It contains meta data data about data
Schema of table is an example of meta data
A database system consults the data directory before reading and
modifying the actual data.
o Indices It provides fast access to data items that holds particular
values.
o Statistical data Stores information/statistics of data stored.
2. Storage Manager
Storage manager is a program module that provide interface between,
o Low level data stored in database and
o Application programs and
o Queries submitted to system.
Storage manager is responsible for the interaction with file manager.
Storage manager translates DML statements into low-level file system
commands.
Storage manager is responsible for
o Storing
o Retrieving
o Updating data in database
Components of Storage manager
a) Authorization and integrity manager
o Checks authority of users accessing the data
o It tests integrity and constraints of data
b) Transaction manager
o It ensures that the database remains in a consistent state despite of failure.
o Concurrent execution in maintained without any conflict.
c) File manager
o It manages allocation of space on disk storage
o Information stored on disk is represented using database.
d) Buffer manager
o It is responsible for fetching data from disk storage into main memory.
o It decides what data to cache the main memory
3. Query processor
Query processor is an important part of the database system
It helps the database system to simplify and facilitate access to data.
Various components of Query processor
a) DDL Interpreter
o It interprets DDL statements into low level.
o Records the definition in the data directory.
b) DML Compiler
o It translates DML query statement in query language into low-level
instruction.
o Query evaluation engine understands only low level instruction.
o Query can be translated into many number of evaluation plans which
produces same result.
o Query optimization is picking up the lowest cost evaluation plan among
many alternatives. It is performed by DML compiler.
c) Query evaluation engine
o Executes low level instruction generated by DML compiler.
Database architecture can be of two types,
Two Tier Architecture
Three Tier Architecture
Two Tier Architecture
Usually database application is partitioned into two parts.
The two-tier is based on Client Server architecture.
The two-tier architecture is like client server application.
The direct communication takes place between client and server.
There is no intermediate between client and server.
Three Tier Architecture
In Three tier architecture, client machine acts as front end and does not contain
any direct database calls.
Instead client end communicate with an application server
Application server in turn communicates with a database system to access data.
Three-tier architecture typically comp comprises a presentation tier, a business or data
access tier, and a data tier. Three layers in the three tier architecture are as follows:
1) Client layer, 2) Business layer
layer, 3) Data layer
1) Client layer:
It is also called as Presentation layer which containss UI part of our application.
This layer is used for the design purpose where data is presented to the user or
input is taken from the user.
For example designing registration form which contains text box, label, button
etc.
2) Business layer:
In this layer
yer all business logic written like validation of data, calculations, data
insertion etc.
This acts as an interface between Client layer and Data Access Layer.
This layer is also called the intermediary layer helps to make communication
faster between client
ient and data layer.
3) Data layer:
In this layer actual database is comes in the picture.
Data Access Layer contains methods to connect with database and to perform
insert, update, delete, get data from database based on our input data.