L04-Database Architecture

Download as pdf or txt
Download as pdf or txt
You are on page 1of 20

L04 - Database Engine

Storage Manager, Query Processor, Transaction Management,


Database Architecture, Database Users
Database Administrator
• A person who has central control over the system is called a database
administrator (DBA).

• Functions of a DBA include:


• Schema definition
• Storage structure and access-method definition
• Schema and physical-organization modification
• Granting of authorization for data access
• Routine maintenance
• Periodically backing up the database
• Ensuring that enough free disk space is available for normal operations, and
upgrading disk space as required
• Monitoring jobs running on the database

15-Aug-22 Database Engine 2


Database Engine
• 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 divided into


• The storage manager,
• The query processor component,
• The transaction management component.

15-Aug-22 Database Engine 3


Storage Manager
• 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 to the following tasks:
• Interaction with the OS file manager
• Efficient storing, retrieving and updating of data
• The storage manager components include:
• Authorization and integrity manager
• Transaction manager
• File manager
• Buffer manager - Control memory to store data pages.Physical I/O as
DB Server reads and writes database pages.

15-Aug-22 Database Engine 4


Storage Manager
• The storage manager implements several data structures
as part of the physical system implementation:
• Data files -- store the database itself
• Data dictionary -- stores metadata about the structure
of the database, in particular the schema of the
database.
• Indices -- can provide fast access to data items. A
database index provides pointers to those data items
that hold a particular value.

15-Aug-22 Database Engine 5


Query Processor
• The query processor components include:
• DDL interpreter -- interprets DDL statements and records
the definitions in the data dictionary.
• DML compiler -- translates DML statements in a query
language into an evaluation plan consisting of low-level
instructions that the query evaluation engine understands.
• The DML compiler performs query optimization; that is, it
picks the lowest cost evaluation plan from among the
various alternatives.
• Query evaluation engine -- executes low-level instructions
generated by the DML compiler.
15-Aug-22 Database Engine 6
Query Processing
1. Parsing and translation
2. Optimization
3. Evaluation

15-Aug-22 Database Engine 7


Transaction Management
• A transaction is a collection of operations that performs a
single logical function in a database application

• Transaction-management component ensures that the


database remains in a consistent (correct) state despite system
failures (e.g., power failures and operating system crashes) and
transaction failures.

• Concurrency-control manager controls the interaction among


the concurrent transactions, to ensure the consistency of the
database.

15-Aug-22 Database Engine 8


Database Architecture
• Centralized databases
• One to a few cores, shared memory
• Client-server,
• One server machine executes work on behalf of multiple client machines.
• Parallel databases
• Many core shared memory
• Shared disk
• Shared nothing
• Distributed databases
• Geographical distribution
• Schema/data heterogeneity

15-Aug-22 Database Engine 9


Database Architecture (Centralized/Shared-Memory)

15-Aug-22 Database Engine 10


Database Applications
• Database applications are usually partitioned into two or three parts

• Two-tier architecture -- the application resides at the client machine,


where it invokes database system functionality at the server machine

• Three-tier architecture -- the client machine acts as a front end and


does not contain any direct database calls.
• The client end communicates with an application server, usually
through a forms interface.
• The application server in turn communicates with a database system
to access data.

15-Aug-22 Database Engine 11


Two-tier and three-tier architectures

15-Aug-22 Database Engine 12


1- Tier DBMS Architecture
• In One- Tier Architecture the database is
directly available to the user, the user
can directly sit on the DBMS and use it
i.e.; the client, server and the Database
all present on the same machine.
• For Example- To learn SQL we setup
SQL server and the database on the
local system.
• This enable us to directly interact with
the relational database and execute
operation.
• Industry won’t use this architecture they
logically go for 2-Tier and 3-Tier
Architecture.

15-Aug-22 Database Engine 13


2-Tier Architecture
• The 2-Tier architecture is same as basic
client-server. In the two-tier architecture,
applications on the client end can directly
communicate with the database at the
server side.
• The user interfaces and application
programs are run on the client-side.
• The server side is responsible to provide
the functionalities like: query processing
and transaction management.
• To communicate with the DBMS, client-
side application establishes a connection
with the server side.

15-Aug-22 Database Engine 14


3-Tier Architecture
• The 3-Tier architecture contains another
layer between the client and server. In this
architecture, client can't directly
communicate with the server.
• The application on the client-end interacts
with an application server which further
communicates with the database system.
• End user has no idea about the existence
of the database beyond the application
server. The database also has no idea
about any other user beyond the
application.
• The 3-Tier architecture is used in case of
large web application.

15-Aug-22 Database Engine 15


Database Users

15-Aug-22 Database Engine 16


Different types of Database Users
• Database Administrator (DBA) :
• Database Administrator (DBA) is a person/team who defines the schema and also
controls the 3 levels of database.
• The DBA will then create a new account id and password for the user if he/she
need to access the data base.
• DBA is also responsible for providing security to the data base and he allows only
the authorized users to access/modify the data base.
• DBA also monitors the recovery and back up and provide technical support.
• The DBA has a DBA account in the DBMS which called a system or superuser
account.
• DBA repairs damage caused due to hardware and/or software failures.

15-Aug-22 Database Engine 17


Naive / Parametric End Users
• Parametric End Users are the unsophisticated who don’t have any
DBMS knowledge, but they frequently use the data base applications in
their daily life to get the desired results.

• For examples, Railway’s ticket booking users are naive users.

• Clerks in any bank is a naive user because they don’t have any DBMS
knowledge but they still use the database and perform their given task.

15-Aug-22 Database Engine 18


System Analyst and Sophisticated Users
• System Analyst is a user who analyzes the requirements of parametric
end users.
• They check whether all the requirements of end users are satisfied.

• Sophisticated users can be engineers, scientists, business analyst,


who are familiar with the database.
• They can develop their own data base applications according to their
requirement.
• They don’t write the program code but they interact the data base by writing SQL
queries directly through the query processor.

15-Aug-22 Database Engine 19


Data Base Designers, Application Program and Casual
Users / Temporary Users
• Data Base Designers
• Data Base Designers are the users who design the structure of data base which
includes tables, indexes, views, constraints, triggers, stored procedures. He/she
controls what data must be stored and how the data items to be related.
• Application Program
• Application Program are the back-end programmers who writes the code for the
application programs. They are the computer professionals. These programs
could be written in Programming languages such as Visual Basic, Developer, C,
FORTRAN, COBOL etc.
• Casual Users / Temporary Users
• Casual Users are the users who occasionally use/access the data base but each
time when they access the data base they require the new information, for
example, Middle or higher-level manager.

15-Aug-22 Database Engine 20

You might also like