0% found this document useful (0 votes)
17 views85 pages

DBMS 1

Uploaded by

maheshgiri9988
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views85 pages

DBMS 1

Uploaded by

maheshgiri9988
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

Database

Management System
Unit I
BIM 4th

by Chakra Narayan Rawal


Traditional File Based System
• File-based System (Predecessor to the DBMS)
A collection of application programs that perform services
for the end-users such as the production of reports.
• Each program defines and manages its own data.
• information are stored in data files
• Each file is a sequence of records
• Limitations of File-Based Approach:
• Separation and isolation of data
• Duplication of data
• Data dependence
• Incompatibility of files
• Fixed queries

by Chakra Narayan Rawal


Database

Collection of interrelated data of an enterprise in a


particular subject.
It is a collection of data in an organized manner in a
persistence media so that sorting and retrieving data
will be easier.
Size of the database is not fixed and it can vary.
A database can be gereated and maintained
manually or by computer.
Eg. Library card catlog, telephone dairy.

by Chakra Narayan Rawal


DBMS
• It is collection of programs (software) which is used
to create manipulate (insert, retrieve, delete,
update) data in a database.
• It also facilitates the process of defining,
constructing, manipulating and sharing database
among various users and applications.
• A dbms is a 4th generation language.
• Eg. Oracle, SQL Server, MS-Access, MySQL

by Chakra Narayan Rawal


by Chakra Narayan Rawal
Application of Database System
• Banking: for customer information, accounts, loans,
transaction etc.
• Airlines: for reservation and schedule information
• Universities for student information, examination
information, department information etc.
• Credit Card Transacitons: for purchase through credit card
and generation of monthly statement.
• Telecommunications keeping records of calls made,
generating monthly bills storing information about monthly
bills, storing information about communication network etc.
• Finance: storing information about sales and purchase of
shares, stocks, bonds etc.
• Human resource : storing information about employees,
salaries, benefits etc.
• Internet : storing user-id, password
by Chakra Narayan Rawaletc in mailing system.
Database System VS File System
• Data Redundancy:
Same information may be duplicated in several files. For example the
information of a particular customer may appear in two different files one
storing saving account records and another storing lean account records.
in database oriented approach duplicate records are avoided because here
relationship is used.
• Data inconsistency:
Data redundancy may leads to data inconsistency. For example any change to
records of one file will not affect the records of other file.
In database oriented approach no redundancy of data son no chance of data
inconsistency.
• Difficulty in accessing data:
Conventional file-processing environments do not allow needed data to be
retrieved in a convenient and efficient manner, for example to find out the list
of customers who live in a particular area we have to search in multiple files
separately.
Database system can handle any type of query and produces the required
information conveniently.
by Chakra Narayan Rawal
• Data Isolation:
Data are scattered in various files and the format of
these data may be different, retrieving the
appropriate data is difficult.
In database system data are stored in one place. So
data will be accessed in a faster manner.
Data Integrity Problems:
Data are stored in different places in different
formats. So while combining to get the require data
integrity (uniformity) problems are created.
In database system as relationship is used there is no
chance of data integrity problem.
by Chakra Narayan Rawal
• Atomicity Problems:
In case of system failure data should be stored to the consistent state that
existed prior to the failure. This is called atomicity it is difficult to ensure
atomicity in file oriented approach.
In database system atomicity can be ensured easily by writing code for
that.
• Concurrent-access anomalies:
When multiple users access the same data simultaneously then there is a
chance of data inconsistency.
In database management system guard against this possibility by some
form of supervision.
• Security:
NO Security in file oriented approach. Any user can access all data.
In database oriented approach access restricted. Data available only for
certain group only.
• Standards:
No standard is maintained in file-oriented approach.
by Chakra Narayan Rawal
In database-oriented approach valid data are stored only.
Characteristics of the
Database Approach
• Self-describing nature of a database system
• Insulation between programs and data, and
• Data abstraction
• Support of multiple views of the data
• Sharing of data and multiuser transaction processing

by Chakra Narayan Rawal


Self-describing nature of a database system
A Database System contains not only the database itself but
also the descriptions of database structure and constraints
(meta-data).
This information is used by the DBMS software or database
users if needed. This separation makes a database system
totally different from the traditional file-based system in
which the data definition is a part of application programs.
Insulation between programs and data
In the file based system, the structure of the data files is
defined in the application programs so if a user wants to
change the structure of a file, all the programs that access
that file might need to be changed as well.
On the other hand, in the database approach, the data
structure is stored in the system catalog not in the programs.
Therefore, one change is all that’s needed.
by Chakra Narayan Rawal
Data abstraction
The characteristic that allows program-data independence and program-
operation independence is called data abstraction.
Support of multiple views of the data
A view is a subset of the database which is defined and dedicated for
particular users of the system. Multiple users in the system might have
different views of the system. Each view might contain only the data of
interest to a user or a group of users.
Sharing of data and multiuser transaction processing
A multiuser database system must allow multiple users access to the
database at the same time. As a result, the multiuser DBMS must have
concurrency control strategies to ensure several users access to the same
data item at the same time, and to do so in a manner that the data will
always be correct – data integrity.
The DBMS must include concurrency control subsystems to ensure that
several users trying to update the same data do so in a controlled manner.
The results of any updates to the database must maintain consistency and
validity.
A fundamental role of multiuser DBMS software is to ensure that
concurrent transactions operate correctly and efficiently.
by Chakra Narayan Rawal
Database Users
• Database administrators
• Database designers
• End users
• System Analysts and
• Application Programmers

by Chakra Narayan Rawal


Database Administrator
A person or a group of people in the organization who
is responsible for authorizing the access to the
database, monitoring its use and managing all the
resource to support the use of the whole database
system.
DBA has central control overall system.
The function/role of the DBA include:
• Schema Definition
• Storage Structure and Access-method Definition
• Granting of authorization for data access
• Routine maintenance
by Chakra Narayan Rawal
Schema Definition: The DBA creates the original database
schema by a set of data definition statements in the DDL.
Storage Structure and Access-method Definition: DBA decides
what structure to be used to store the data and what method
to be used to access that.
Schema and Physical-organization modification: According to
the need of the organization the DBA carries out changes to the
schema and physical organization to improve the performance.
Granting of authorization for data access: The DBA
administrator decides which user will access which part of the
database.
Routine maintenance: DBA does some of the routine
maintenance like periodically backing up the database,
ensure that enough free disk space available for normal
operations, monitors jobs running on the database etc.
by Chakra Narayan Rawal
End users
• These are people whose jobs require access to a database
for querying, updating and generating reports.
• Naive Users/Parametric Users: These are unsophisticated
users who interact with the system by invoking one of the
application programs that have been written previously.
• They also read reports form the database. eg. bank teller, a
person checking his balance through internet.
• Sophisticated users: These users interact with the system
without writing programs. They form their request in a
database query language and submit it to the query
processor.
• Eg. scientists, Business Analysts who need some
summarized data. They use some of the tools like online
Analytical processing (OLAP), Data Mining that views them
the summarized data in different ways.
by Chakra Narayan Rawal
• Specialized Users: These are sophisticated users who
write specialized database applications that don't fit
into the traditional data processing framework.
Eg. CAD system, Knowledge based expert system,
Environment modeling system etc.
• Application Programmers: People implement
specific application programs to access to the stored
data. This kind of user needs to be familiar with the
DBMSs to accomplish their task.

by Chakra Narayan Rawal


In addition to those who design, use, and administer
a database, others are associated with the design,
development, and operation of the DBMS software
and system environment.
• DBMS system designers and implementers
• Tool developers
• Operators and maintenance personnel

by Chakra Narayan Rawal


DBMS system designers and implementers design
and implement the DBMS modules and interfaces as
a software package.
• A DBMS is a very complex software system that
consists of many components, or modules,
including modules for implementing the catalog,
query language processing, interface processing,
accessing and buffering data, controlling
concurrency, and handling data recovery and
security.
• The DBMS must interface with other system
software such as the operating system and
compilers for various programming languages.

by Chakra Narayan Rawal


Tool developers design and implement tools—the software
packages that facilitate database modeling and design,
database system design, and improved performance.
Tools are optional packages that are often purchased
separately. They include packages for database design,
performance monitoring, natural language or graphical
interfaces, prototyping, simulation, and test data generation.
In many cases, independent software vendors develop and
market these tools.
Operators and maintenance personnel (system
administration personnel) are responsible for the actual
running and maintenance of the hardware and software
environment for the database system.
Although these categories of workers behind the scene are
instrumental in making the database system available to end
users, they typically do not use the database contents for their
own purposes.
by Chakra Narayan Rawal
Advantages of Using the DBMS Approach

These capabilities are in addition to the four main


characteristics discussed.
The DBA must utilize these capabilities to accomplish
a variety of objectives related to the design,
administration, and use of a large multiuser database.
• Controlling redundancy
• Restricting unauthorized access
• Providing persistent storage
• Providing storage structures and
• search techniques for efficient query processing
• Providing backup and recovery
by Chakra Narayan Rawal
• providing multiple user interfaces
• Enforcing integrity constraints
• Reduced application development time
• Flexibility
• Availability of up-to-date information
• Economies of scale

by Chakra Narayan Rawal


Controlling Redundancy
This redundancy in storing the same data multiple times leads to
several problems.
Centralized control of data avoids duplication of data, which decreases
the storage cost and eliminates data inconsistencies.
Restricting Unauthorized Access
When multiple users share a large database, it is likely that most users
will not be authorized to access all information in the database.
For example, financial data is often considered confidential, and only
authorized persons are allowed to access such data. In addition, some
users may only be permitted to retrieve data, whereas others are
allowed to retrieve and update.
A DBMS should provide a security and authorization subsystem, which
the DBA uses to create accounts and to specify account restrictions.
Then, the DBMS should enforce these restrictions automatically.
Enforcing integrity constraints
DBMS uses no of checks before storing any data in the database. By
doing this DBMS ensures the data are correct and consistent.
by Chakra Narayan Rawal
• Providing persistent storage
Databases can be used to provide persistent storage for
program objects and data structures.
Programming languages typically have complex data
structures, such as record types in Pascal or class
definitions in C++ or Java. The values of program variables
or objects are discarded once a program terminates,
unless the programmer explic-itly stores them in
permanent files, which often involves converting these
complex structures into a format suitable for file storage.
Object-oriented database systems are compatible with
programming languages such as C++ and Java, and the
DBMS software auto-matically performs any necessary
conversions.
by Chakra Narayan Rawal
• Providing storage structures and search techniques for efficient query
processing
Database systems must provide capabilities for efficiently executing queries
and updates.
Because the database is typically stored on disk, the DBMS must
provide specialized data structures and search techniques to speed up disk
search for the desired records.
Auxiliary files called indexes are used for this purpose.
Indexes are typically based on tree data structures or hash data structures
that are suitably modified for disk search.
In order to process the database records needed by a particular query,
those records must be copied from disk to main memory.
Therefore, the DBMS often has a buffering or caching module that
maintains parts of the data-base in main memory buffers.
In general, the operating system is responsible for disk-to-memory
buffering.
However, because data buffering is crucial to the DBMS performance, most
DBMSs do their own data buffering.
by Chakra Narayan Rawal
The query processing and optimization module of the DBMS is
responsible for choosing an efficient query execution plan for
each query based on the existing storage structures.
Providing backup and recovery
A DBMS must provide facilities for recovering from hardware or
software failures.
The backup and recovery subsystem of the DBMS is responsible
for recovery.
For example, if the computer system fails in the middle of a
complex update transaction, the recovery subsystem is
responsible for making sure that the database is restored to the
state it was in before the transaction started executing.
Alternatively, the recovery subsystem could ensure that the
transaction is resumed from the point at which it was interrupted
so that its full effect is recorded in the database. Disk backup is
also necessary in case of a catastrophic disk failure.
by Chakra Narayan Rawal
• providing multiple user interfaces
Because many types of users with varying levels of
technical knowledge use a data-base, a DBMS should
provide a variety of user interfaces.
- query languages interface of casual user
- programming language interface for programmers
- forms and command code for parametric users
- menu driven and interfaces for standalone users

by Chakra Narayan Rawal


Enforcing integrity constraints

Most database applications have certain integrity


constraints that must hold for the data.
A DBMS should provide capabilities for defining and
enforcing these constraints. The simplest type of
integrity constraint involves specifying a data type for
each data item.

by Chakra Narayan Rawal


• Reduced application development time
Designing and implementing a large multiuser database from scratch
may take more time than writing a single specialized file application.
However, once a database is up and running, substantially less time
is generally required to create new applications using DBMS
facilities.
Flexibility
It may be necessary to change the structure of a database as
requirements change.
For example, a new user group may emerge that needs information
not currently in the database.
In response, it may be necessary to add a file to the database or to
extend the data elements in an existing file. Modern DBMSs allow
certain types of evolutionary changes to the structure of the
database without affecting the stored data and the existing
application programs.
by Chakra Narayan Rawal
• Availability of up-to-date information
A DBMS makes the database available to all users.
As soon as one user’s update is applied to the database, all other users
can immediately see this update.
This availability of up-to-date information is essential for many
transaction-processing applications, such as reservation systems or
banking databases, and it is made possible by the concurrency control
and recovery subsystems of a DBMS.
• Economies of scale
The DBMS approach permits consolidation/integration of data
and applications, thus reducing the amount of wasteful overlap
between activities of data-processing personnel in different projects or
departments as well as redundancies among applications.
This enables the whole organization to invest in more powerful
processors, storage devices, or communication gear, rather than having
each department purchase its own (lower performance) equipment.
This reduces overall costs of operation and management.
by Chakra Narayan Rawal
Review

by Chakra Narayan Rawal


by Chakra Narayan Rawal
Disadvantages of DBMS
• Problem associated with centralization
• Cost of software
• Cost of hardware
• Complexity of backup and recovery

by Chakra Narayan Rawal


When Flat-File Systems are suitable?
• Flat file systems are more suitable to use rather
than database management systems in following
situations:
• When system to be developed is simple and
small
• When we need to manage few data (up to 2-3
data files)
• When security is not major concern
• When concurrent access is not needed

by Chakra Narayan Rawal


Advantages of Flat-file
Systems
• Initial Investment
• Dedicated Staff
• Overhead

by Chakra Narayan Rawal


Data abstraction
Data abstraction is the process of easy interface to users
by hiding underlying complexities of data management
from users.
Database System provides users with an abstract view
of the data.
Data abstraction is provided in database management
systems by using three-level schema
(ANSI-SPARC Architecture) architecture.
ANSI-SPARC stands for American National Standards Institute, Standards Planning And
Requirements Committee, is an abstract design standard for a Database Management
System (DBMS), first proposed in 1975.

Compiled by Chakra Narayan Rawal


Data Model
A collection of concepts that can be used to describe
the structure of a database provides the necessary
means to achieve abstraction.
By structure of a database we mean
the data types, relationships, and constraints that
apply to the data.
Most data models also include a set of basic
operations for specifying retrievals and updates on the
database.

Compiled by Chakra Narayan Rawal


Categories of Data Models
Data model categorize according to the types of concepts
they use to describe the database structure.
a) High-level or conceptual data mode
b) Low-level or physical data model
• High-level or conceptual data models provide concepts that
are close to the way many users perceive data, whereas
low-level or physical data models provide concepts that
describe the details of how data is stored on the computer
storage media, typically magnetic disks.
• Concepts provided by low-level data models are generally
meant for computer specialists, not for end users.
• Conceptual data models use concepts such as entities,
attributes, and relationships.
Compiled by Chakra Narayan Rawal
Schemas and Instances
Schemas:
• The overall description or design of the database is
called as the Database Schema.
• A schema is defined as an outline or a plan that
describes the records existing at a particular level.

Fig. Schema diagram for database

Compiled by Chakra Narayan Rawal


Instances
The collection of information stored in the database at a
particular moment is called as an instance of the
database.
The schema remains the same while the data stored in it
changes form instant to instant.
# data state/snapshot/current set/instances of the
database

Compiled by Chakra Narayan Rawal


Data Model
A collection of concepts that can be used to describe
the structure of a database provides the necessary
means to achieve abstraction.
By structure of a database we mean
the data types, relationships, and constraints that
apply to the data.
Most data models also include a set of basic
operations for specifying retrievals and updates on the
database.

Compiled by Chakra Narayan Rawal


Database Model
• Hierarchical Model
• Network Mode
• Entity-Relationship Model
• Relational Model
• Object Oriented Model

Compiled by Chakra Narayan Rawal


Hierarchical Model

Compiled by Chakra Narayan Rawal


Hierarchical Model
• The oldest type of data model.
• The record base representational or implementation
data model.
• In this model different records are inter-related
through hierarchical or tree-like structures.
• A parent record can have several children, but a child
can have only one parent.
• It, therefore, represents only one-to-one and one-to-
many relationships.

Compiled by Chakra Narayan Rawal


Network Data Model
• It is an extension of the hierarchical database
structure.
• It is also record based representational data model.
• more flexible than hierarchical data model.
• It describes data and relations between data by using
graph rather than tree like structure.
Thus unlike network data model is able to represent
many-to-many relationships also.

Compiled by Chakra Narayan Rawal


Network Model

Compiled by Chakra Narayan Rawal


Entity- Relationship Model
• The ER data models is based on a perception of real
world that consist of a collection of basic objects called
entities and relationship among these objects.
• In this model database can be modeled as a collection
of entities, and relationship among entities.
• It is one of the conceptual data model and describes
the information used by an organization in a way that is
independent of any implementation-level issues and
details.
• Hence, ER model can be understood even by the end
users having non-technical background. Overall logical
structure of a database can be expressed graphically by
E-R diagram.
Compiled by Chakra Narayan Rawal
The basic components of this diagram are:
• Rectangles (represent entity sets)
• Ellipses (represent attributes)
• Diamonds (represent relationship sets among entity
sets)
• Lines (link attributes to entity sets and entity sets to
relationship sets)

Compiled by Chakra Narayan Rawal


Compiled by Chakra Narayan Rawal
Relational Model
In the relational data model, unlike the hierarchical and network
models, there are no physical links.
All data is maintained in the form of tables (generally, known as
relations) consisting of rows and columns.
Each row (record) represents an entity and a column (field)
represents an attribute of the entity.
The relationship between the two tables is implemented through a
common attribute in the tables and not by physical links or
pointers.
This makes the querying much easier in a relational database
system than in the hierarchical or network database systems.
Thus, the relational model has become more programmers friendly
and much more dominant and popular in both industrial and
academic scenarios.
Compiled by Chakra Narayan Rawal
• It is a most widely used data model. Relational model
is lower level abstraction than E-R model.
• Database model are often carried out in E-R model
and then translated into relational mode

Compiled by Chakra Narayan Rawal


Object oriented data model
The object oriented data model is based on object-
oriented programming paradigm.
It is based on the concept of encapsulating the data and
the functions that operate on those data in a single
unit called an object.
The internal parts of objects are not visible externally.
Here one object communicates with other objects by
sending message.

Compiled by Chakra Narayan Rawal


Compiled by Chakra Narayan Rawal
Three-Schema Architecture and Data Independence

• Concept of three-schema architecture


• Logical and physical data independence

Compiled by Chakra Narayan Rawal


The Three-Schema Architecture
Data abstraction is provided in database management
systems by using three-level schema
(ANSI-SPARC Architecture) architecture.
ANSI-SPARC stands for American National Standards
Institute, Standards Planning And Requirements
Committee, is an abstract design standard for
a Database Management System (DBMS), first proposed
in 1975.
• External Level
• Conceptual Level
• Internal Level

Compiled by Chakra Narayan Rawal


The Three-Schema Architecture

Compiled by Chakra Narayan Rawal


Physical Level
• The internal level has an internal schema, which
describes the physical storage structure of the database.
• It is the lowest level of abstractions and describes how
the data are actually stored on disk and some of the
access mechanisms commonly used for retrieving this
data.
• The internal schema uses a physical data model and
describes the complete details of data storage and
access paths for the database.
• The main objective is to optimize performance by
minimizing the number of disk accesses during the
various database operations.
• DBMS developer is the person who deals with this
level .
Compiled by Chakra Narayan Rawal
Logical Level
• The conceptual level has a conceptual schema, which
describes the structure of the whole database for a
community of users.
• The conceptual schema hides the details of physical
storage structures and concentrates on describing
entities, data types, relationships, user operations,
and constraints.
• Logical level describes the stored data in terms of the
data model of the DBMS.
• Programmers and database administrator works at
this level of abstraction.

Compiled by Chakra Narayan Rawal


External Level
• The external or view level includes a number
of external schemas or user views.
• Each external schema describes the part of the
database that a particular user group is interested in
and hides the rest of the database from that user
group.
• At view level, computer users see a set of application
programs that hide details of data types.
• Views also plays vital role to provide security
mechanism to prevent users from accessing certain
parts of the database.

Compiled by Chakra Narayan Rawal


Data Independence
The capacity to change the database schema without
affecting application programs is called data
independence.
Database system provides two types of data
independence:
• Logical Data Independence and
• Physical Data Independence.
Logical Data Independence
The capacity to change the conceptual (logical level) schema
without having to change associated application programs is
called logical data independence.
If the underlying conceptual schema is changed, the definition
of a view relation can be modified so that the same relation is
computed as before.
Compiled by Chakra Narayan Rawal
Database administrator is responsible for redefining view
level schema.
When modification is done to the conceptual schema (i.e
tables) only the external/conceptual mapping need to be
changed, if the DBMS fully supports the concept of data
independence.
Physical Data Independence
The capacity to change the internal schema without affecting
application programs is called physical data independence.
This means we can change physical level storage details such
as file structure; indexes as long as conceptual schema
remains same without altering associated application
programs.
But performance may be affected due to changes in physical
level. It is the responsibility of the DBA to manage such
changes.
Compiled by Chakra Narayan Rawal
Database Languages
• Languages that are used to interact with database
management systems are called database languages.
• DDL and
• DML
Data Definition Language (DDL):
Database language that is used to create, delete or modify
database schema is called data definition language.
• DDL statements are converted into equivalent low level
statements by DDL interpreter.
• DDL is used by the database administrators or database
designers to specify the conceptual schema of a database

Compiled by Chakra Narayan Rawal


DDL
In many DBMSs, the DDL is also used to define internal
and external schemas (views).
Results of DDL statements are recorded in special file
called data dictionary. Structured query language
supports following DDL statements:
Create statement
Drop statement
Alter statement
The DDL provides the facilities to define:
Database schema, Database tables, Integrity
constraints, views, Security and Authorization, Modify
the Schema etc.

Compiled by Chakra Narayan Rawal


• Execution of the above DDL statement creates the
account table and it updates a special set of tables
called the data dictionary.
• Data dictionary is a special file that stored metadata.
• Data bout data is called metadata.
• More accurately we can say that information about
conceptual database schema is stored in data
dictionary.

Compiled by Chakra Narayan Rawal


• The DDL provides the facilities to define:
• Database scheme
• Database tables
• Integrity constraints
• Domain constraints
• Referential integrity (references constraint in SQL)
• Assertions
• Triggers
• Views
• Security and Authorization
• Modify the Scheme
Compiled by Chakra Narayan Rawal
Data Manipulation Language (DML)
Database language that enables insert, delete, update, and
retrieve data from database is called data manipulation
language (DML).
Query language is only a part of data manipulation language.
DML statements are converted into equivalent low level
statements by DML compiler.
Structured query language supports following DML
statements:
• Insert statement
• Delete statement
• Update statement
• Select statement
Compiled by Chakra Narayan Rawal
There are basically two classes of DML:
• Procedural DMLs: In procedural DMLs, a user specifies
what data are required and how to get those data.
• These are normally low level data manipulation
languages.
• Relational algebra is an example of procedural DML.
Nonprocedural DMLs:
• In nonprocedural DMLs a user specifies what data are
needed without specifying how to get those data.
• These are normally high level data manipulation
languages.
• Structured query language (SQL) is an example of
nonprocedural DML.
Compiled by Chakra Narayan Rawal
Centralized and Client/Server Architectures for DBMS

The design of a DBMS depends on its architecture.


It can be centralized or decentralized or hierarchical.
Centralized DBMSs Architecture:
A centralized database is stored at a single location such
as a mainframe computer.
It is maintained and modified from that location only
and usually accessed using an internet connection such
as a LAN or WAN.
The centralized database is used by organisations such
as colleges, companies, banks etc.

Compiled by Chakra Narayan Rawal


As can be seen from the above diagram, all the information for the
organisation is stored in a single database. This database is known as
the centralized database.

Compiled by Chakra Narayan Rawal


Advantages
• Some advantages of Centralized Database Management System are:
• The data integrity is maximized as the whole database is stored at a
single physical location. This means that it is easier to coordinate
the data and it is as accurate and consistent as possible.
• The data redundancy is minimal in the centralized database. All the
data is stored together and not scattered across different locations.
So, it is easier to make sure there is no redundant data available.
• Since all the data is in one place, there can be stronger security
measures around it. So, the centralized database is much more
secure.
• Data is easily portable because it is stored at the same place.
• The centralized database is cheaper than other types of databases
as it requires less power and maintenance.
• All the information in the centralized database can be easily
accessed from the same location and at the same time.
Compiled by Chakra Narayan Rawal
Disadvantages
• Some disadvantages of Centralized Database
Management System are:
• Since all the data is at one location, it takes more time
to search and access it. If the network is slow, this
process takes even more time.
• There is a lot of data access traffic for the centralized
database. This may create a bottleneck situation.
• Since all the data is at the same location, if multiple
users try to access it simultaneously it creates a
problem. This may reduce the efficiency of the system.
• If there are no database recovery measures in place and
a system failure occurs, then all the data in the database
will be destroyed.
Compiled by Chakra Narayan Rawal
Compiled by Chakra Narayan Rawal
2-tier DBMS Architecture
2-tier DBMS architecture includes an Application layer
between the user and the DBMS,
which is responsible to communicate the user's request to
the database management system and then send the
response from the DBMS to the user.
The application program interface standards like Open
Database Connectivity (ODBC) and Java Database
Connectivity (JDBC) are used for interaction between
client and server.
Such an architecture provides the DBMS extra security as
it is not exposed to the End User directly.
• Also, security can be improved by adding security and
authentication checks in the Application layer too.
Compiled by Chakra Narayan Rawal
Compiled by Chakra Narayan Rawal
3-tier DBMS Architecture
3-tier DBMS architecture is the most commonly used
architecture for web applications.
It is an extension of the 2-tier architecture.
In the 2-tier architecture, we have an application layer
which can be accessed programatically to perform
various operations on the DBMS.
The application generally understands the Database
Access Language and processes end users requests to
the DBMS.

Compiled by Chakra Narayan Rawal


In 3-tier architecture, an additional Presentation or
GUI Layer is added, which provides a graphical user
interface for the End user to interact with the DBMS.
For the end user, the GUI layer is the Database
System, and the end user has no idea about the
application layer and the DBMS system.
If you have used MySQL, then you must have seen
PHPMyAdmin, it is the best example of a 3-tier DBMS
architecture.

Compiled by Chakra Narayan Rawal


Compiled by Chakra Narayan Rawal
Database + DBMS=Database System
DBMS Components:
A DBMS environment consists of five main
components (or actors) :
a) Hardware
b) Software (DBMS + Application program + OS)
c) Data
d) Users
e) Procedures

Compiled by Chakra Narayan Rawal


Fig. DBMS Components

Compiled by Chakra Narayan Rawal


Database System Structure

Compiled by Chakra Narayan Rawal


A database system being a complex software system is
partitioned into several software components that
handle various tasks such as data definition and
manipulation, security and data integrity, data buffering,
data recovery and concurrency control, and performance
optimization.
The functional components of a database system can be
broadly divided into the storage manager and the query
processor components.

by Chakra Narayan Rawal


Storage Manager
• The storage manager translates the various DML statements into low-level
file-system commands.
• Storage manager is responsible for storing, retrieving, and updating data in
the database. The storage manager components include:
• Authorization and integrity manager: tests for the satisfaction of integrity
constraints and checks the authority of users to access data.
• Transaction manager: ensures that the database remains in a consistent
state despite system failures, and the concurrent transaction executions
proceed without conflicting.
• File manager: manages the allocation of space on disk storage and the data
structures used to represent information stored on disk.
• Buffer manager: 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.

by Chakra Narayan Rawal


Disk Storage:
Data files: which store the database itself.
Data dictionary: which stores metadata about the
structure of the database, in particular the schema of
the database.
Indices: which provides fast access to data items that
hold particular values.

by Chakra Narayan Rawal


The Query Processor:
The Query Processor is important because it helps
the database system to simplify and facilitate access
to data. High level views help to achieve this goal;
with them, users of the system are not be burdened
unnecessarily with the physical details of the
implementation of the system.
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.
The query processor components are:

by Chakra Narayan Rawal


DDL interpreter: It interprets DDL statements and records
the definitions in the data dictionary.
DML compiler: It 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: It executes low-level instructions
generated by the DML compiler.
by Chakra Narayan Rawal

You might also like