DBMS Architecture
• A Database stores a lot of critical information to access data quickly and
securely. Hence it is important to select the correct architecture for
efficient data management.
• DBMS Architecture helps users to get their requests done while
connecting to the database.
• We choose database architecture depending on several factors like the
size of the database, number of users, and relationships between the
users.
Types of DBMS Architecture
• 1-Tier Architecture
• 2-Tier Architecture
• 3-Tier Architecture
1-Tier Architecture
• In 1-Tier Architecture the database is directly available to the user. The user can
directly sit on the DBMS and use it. Hence the client, server, and database are all
present on the same machine.
• For Example: to learn SQL we set up an SQL server and the database on the local
system. It enables us to directly interact with the relational database and
execute operations.
• The industry won’t use this architecture they logically go for 2-tier and 3-tier
Architecture.
Advantages of 1-Tier Architecture
• Simple Architecture: 1-Tier Architecture is the most simple architecture to set
up, as only a single machine is required to maintain it.
• Cost-Effective: No additional hardware is required for implementing 1-Tier
Architecture, which makes it cost-effective.
• Easy to Implement: 1-Tier Architecture can be easily deployed, and hence it is
mostly used in small projects.
2-Tier Architecture
• The 2-tier architecture is similar to a basic
client-server model.
• The application at the client end directly
communicates with the database on the server
side.
• APIs like ODBC and JDBC are used for this
interaction.
• The server side is responsible for providing
query processing and transaction management
functionalities.
2-Tier Architecture
• On the client side, the user interfaces and application programs are run.
• The application on the client side establishes a connection with the server side to
communicate with the DBMS.
• Advantages of 2-Tier Architecture
❖ Easy to Access: 2-Tier Architecture makes easy access to the database, which makes fast
retrieval.
❖ Maintenace is easier and compatible with existing systems. It gives poor performance
when there are a large number of users.
❖ Scalable: We can scale the database easily, by adding clients or upgrading hardware.
❖ Low Cost: 2-Tier Architecture is cheaper than 3-Tier Architecture and Multi-Tier
Architecture.
❖ Easy Deployment: 2-Tier Architecture is easier to deploy than 3-Tier Architecture.
❖ Simple: 2-Tier Architecture is easily understandable as well as simple because of only
two components.
2-Tier Architecture
• On the client side, the user interfaces and application programs are run.
• The application on the client side establishes a connection with the server side to
communicate with the DBMS.
• Advantages of 2-Tier Architecture
❖ Easy to Access: 2-Tier Architecture makes easy access to the database, which makes fast
retrieval.
❖ Maintenace is easier and compatible with existing systems. It gives poor performance
when there are a large number of users.
❖ Scalable: We can scale the database easily, by adding clients or upgrading hardware.
❖ Low Cost: 2-Tier Architecture is cheaper than 3-Tier Architecture and Multi-Tier
Architecture.
❖ Easy Deployment: 2-Tier Architecture is easier to deploy than 3-Tier Architecture.
❖ Simple: 2-Tier Architecture is easily understandable as well as simple because of only
two components.
3-Tier Architecture
• In 3-Tier Architecture, there is another layer between the client and the server.
• The client does not directly communicate with the server. Instead, it interacts
with an application server which further communicates with the database
system and then the query processing and transaction management takes
place.
• This intermediate layer acts as a medium for the exchange of partially processed
data between the server and the client.
• This type of architecture is used in the case of large web applications.
• Three-Tier Architecture is basically three layers –
❖ First-Tier (The client-tier)
❖ Second-Tier (Application server-tier/middle-tier)
❖ Third-Tier (Database-server-tier)
Advantages of 3-Tier Architecture
• Enhanced scalability: Scalability is enhanced due to the distributed deployment
of application servers. Now, individual connections need not be made between
the client and server.
• Data Integrity: 3-Tier Architecture maintains Data Integrity. Since there is a
middle layer between the client and the server, data corruption can be
avoided/removed.
• Security: 3-Tier Architecture Improves Security. This type of model prevents
direct interaction of the client with the server thereby reducing access to
unauthorized data.
Disadvantages of 3-Tier Architecture
• More Complex: 3-Tier Architecture is more complex in comparison to 2-Tier
Architecture. Communication Points are also doubled in 3-Tier Architecture.
• Difficult to Interact: It becomes difficult for this sort of interaction to take place
due to the presence of middle layers.
Note: When it comes to choosing a DBMS architecture, it all comes
down to how complex and scalable the system is. The 3-level
architecture has the best features and is perfect for modern, big
database systems.
Data Independence
• Data Independence is defined as a property of DBMS that helps you to change
the database schema at one level of a system without requiring to change the
schema at the next level.
• It helps to keep the data separated from all program that makes use of it.
• We have namely two levels of data independence arising from these levels of
abstraction:
❖ Physical level data independence
❖ Logical level data independence
Data Independence
Physical Data Independence
• It refers to the characteristic of being able to modify the physical schema
without any alterations to the conceptual or logical schema, done for
optimization purposes, e.g., the Conceptual structure of the database would
not be affected by any change in storage size of the database system server.
Changing from sequential to random access files is one such example.
• Example: Changes in the lowest level (physical level) are: creating a new file,
storing the new files in the system, creating a new index, etc.
• These alterations or modifications to the physical structure may include:
❖ Utilizing new storage devices.
❖ Modifying data structures used for storage.
❖ Altering indexes or using alternative file organization techniques etc.
Logical Data Independence
• It refers characteristic of being able to modify the logical schema without
affecting the external schema or application program.
• The user view of the data would not be affected by any changes to the
conceptual view of the data.
• The changes may include insertion or deletion of attributes, altering table
structures entities or relationships to the logical schema, etc.
• Example: Changes in the middle level (logical level) are: adding new attributes
to a relation, deleting existing attributes of the relation, etc.
Database Schemas
• A database schema is a logical representation of data that shows how the data in a database
should be stored logically. It shows how the data is organized and the relationship between
the tables.
• Database schema contains table, field, views and relation between different keys like primary
key, foreign key.
• Database schema defines a set of guidelines that control the database along with that it
provides information about the way of accessing and modifying the data.
• A schema acts as the blueprint for a database, describing its overall structure and how each
element relates to another. In effect, it’s an unchanging picture of how the database is
formally organized.
Database Instance
• A database instance is a snapshot of the information contained within a
database at a specific time. This means that, unlike a schema, the information
contained within a database instance can change over time.
• The database instance represents the data and information that is currently
stored in the database at a specific point in time.
• Since the information that is saved in the database is subject to frequent
change, Instance is a representation of a data at a specific time.
Data Model
• A Data Model in Database Management System (DBMS) is the concept of tools
that are developed to summarize the description of the database.
• Data Models provide us with a transparent picture of data which helps us in
creating an actual database.
• It shows us from the design of the data to its proper implementation of data.
Types of Data Model
• Hierarchical Data Model
• Network Data Model
• Entity-Relationship Data Model(ER Model)
• Object Oriented Data Model
Hierarchical Data Model
• This is one of the oldest
models in a data model
which was developed by
IBM, in the 1950s.
• In this, the data is organized
into a tree-like structure
where each record consists
of one parent record and
many children.
Network Data Model
• This model was formalized by the
Database Task group in the 1960s.
• This model is the generalization of the
hierarchical model.
• This model can consist of multiple
parent segments and these segments
are grouped as levels but there exists
a logical association between the
segments belonging to any level.
• Mostly, there exists a many-to-many
logical association between any of the
two segments.
Entity-Relationship Data Model
• The Entity Relationship Diagram explains the relationship among the entities present in
the database.
• ER models are used to model real-world objects like a person, a car, or a company and the
relation between these real-world objects.
• In short, the ER Diagram is the structural format of the database.
• It is basically a conceptual design of any database which is easy to design the view of data.
• Components of ER Model:
1. Entity: An entity is referred to as a real-world object. It can be a name, place, object,
class, etc. These are represented by a rectangle in an ER Diagram.
2. Attributes: An attribute can be defined as the description of the entity. These are
represented by Eclipse in an ER Diagram. It can be Age, Roll Number, or Marks
for a Student.
3. Relationship: Relationships are used to define relations among different entities.
Diamonds and Rhombus are used to show Relationships.
Symbols Used in ER Model
• ER Model is used to model the logical view of the system from a data perspective which
consists of these symbols:
Object Oriented Data Model
• To represent the complex real world problems there was a need for a data model that is
closely related to real world. Object Oriented Data Model represents the real world
problems easily.
• In Object Oriented Data Model, data and their relationships are contained in a single
structure which is referred as object.
• In this, real world problems are represented as objects with different attributes.
• Basically, it is combination of Object Oriented programming and Relational Database
Model as it is clear from the following:
Object Oriented Data Model
= Combination of Object Oriented Programming + Relational database model
Components of Object Oriented Data Model
• Objects: An object is an abstraction of a real world
entity or we can say it is an instance of class.
• Attribute : An attribute describes the properties of
object.
• Methods: Method represents the behavior of an
object. Basically, it represents the real-world
action.
• Class: A class is a collection of similar objects with
shared structure i.e. attributes and behavior i.e.
methods.
• Inheritance : By using inheritance, new class can
inherit the attributes and methods of the old class
i.e. base class
User Interfaces in DBMS
• A database management system (DBMS) interface is a user interface that allows
for the ability to input queries to a database without using the query language
itself.
• User-friendly interfaces provided by DBMS may include the following:
❖ Menu-Based Interfaces
❖ Forms-Based Interfaces
❖ Graphical User Interfaces
❖ Natural Language Interfaces
❖ Speech Input and Output Interfaces
❖ Interfaces for Parametric Users
❖ Interfaces for the Database Administrator (DBA)
Menu-Based Interfaces
• These interfaces present the user with lists of options (called menus) that lead
the user through the formation of a request.
• The basic advantage of using menus is that they remove the tension of
remembering specific commands and syntax of any query language.
• The query is basically composed step by step by collecting or picking options
from a menu that is shown by the system.
• Pull-down menus are a very popular technique in Web-based interfaces.
• Example
In a shopping website, categories are selected from the menu, brands are
selected from the menu of brands, and budget ranges are applied from the
menu of budget range.
Forms-Based Interfaces
• A forms-based interface displays a form to each user.
• Users can fill out all of the form entries to insert new data, or they can fill out
only certain entries, in which case the DBMS will redeem the same type of data
for other remaining entries.
• These types of forms are usually designed or created and programmed for users
that have no expertise in operating systems.
• Example:
SQL Forms is a form-based language that specifies queries using a form
designed in conjunction with the relational database schema.
Graphical User Interface
• A GUI typically displays a schema to the user in diagrammatic form.
• The user then can specify a query by manipulating the diagram.
• In many cases, GUI utilise both menus and forms.
• Most GUI use a pointing device such as a mouse, to pick a certain part of the
displayed schema diagram.
• Example
You liked a video on Instagram by tapping with your finger, and the color
changes to red. The visual graphic gets changed due to user action.
Natural Language Interfaces
• These interfaces accept requests written in English or some other language and
attempt to understand them.
• A Natural language interface has its own schema, which is similar to the database
conceptual schema.
• It also has a directory of important words.
• It generates a query based on the interpretation of important words in the input by
the user and if the interpretation is successful, then it displays the result to the
user.
• The main disadvantage of this is that the capabilities of this type of interface are
not that advance.
• Example: A user googled the fastest car in India, and now the natural language
interface will look for the important words i. e. fastest, car, India, and show the
result accordingly.
Speech Input and Output Interfaces
• The users query the interface with speech and get the answer in speech.
• The Speech input is detected using predefined words and used to set up the
parameters that are supplied to the queries.
• For output, a similar conversion from text or numbers into speech takes place.
• Nowadays, it has become the most common type of interface.
• Example
OK Google, Siri on Apple, and Alexa is used in the form of speech.
Interface for Parametric Users
• Interfaces for Parametric Users contain some commands that can be handled
with a minimum of keystrokes.
• It is generally used in bank transactions for transferring money.
• These operations are performed repeatedly.
Interfaces for Database Administrators (DBA)
• Most database system contains privileged commands that can be used only by
the DBA’s staff.
• These include commands for creating accounts, setting system parameters,
granting account authorization, changing a schema, and reorganizing the
storage structures of databases.
Classification/Types of DBMS
A. Based on the Data Model
❖ Hierarchical Database
❖ Network Database
❖ Object Oriented Database
❖ Relational Database
B. Based on Number of Users
❖ Single User
❖ Multi Users
C. Based on Sites over which network is distribtued
❖ Centralized Database System
❖ Distributed Database System
Types of DBMS based on Number of Users
1. Single User Database
❖ A single-user database system is designed to be used by only one user at a
time.
❖ It is typically installed on a single computer and can only be accessed by the
user who installed it or the user who is currently logged in.
❖ Single-user systems are simpler and less expensive than multi-user systems,
but they are not suitable for environments where multiple users need to
access the same data at the same time. Example: Personal Computers
2. Multi User Database
❖ A multi-user database system, on the other hand, can be accessed by multiple
users simultaneously.
❖ It is typically installed on a network server and can be accessed by users who
are logged in to the network.
❖ Multi-user systems are more complex and require more resources than single-
user systems, but they are essential for organizations where multiple users
need to access the same data at the same time. Example: Databases of Banks,
insurance agencies, stock exchanges, supermarkets, etc.
Types of DBMS based on the Sites over which Network is
Distributed
1. Centralized Database
❖ A centralized database is basically a type of database
that is stored, located as well as maintained at a single
location only.
❖ This type of database is modified and managed from
that location itself.
❖ The centralized location is accessed via an internet
connection (LAN, WAN, etc).
❖ This centralized database is mainly used by
institutions or organizations.
❖ It is cheaper in comparison to all other databases
available.
❖ The data traffic in the case of a centralized database is
more.
❖ If any kind of system failure occurs in the centralized
system then the entire data will be destroyed.
Types of DBMS based on the Sites over which Network is
Distributed
2. Distributed Database
❖ A distributed database is basically a type of
database which consists of multiple databases
that are connected with each other and are
spread across different physical locations.
❖ The data that is stored in various physical
locations can thus be managed independently
of other physical locations.
❖ The communication between databases at
different physical locations is thus done by a
computer network.
❖ This database is very costly and is difficult to
maintain because of its complexity.
❖ In this database, it is difficult to provide a
uniform view to users since it is spread across
different physical locations.
Database System Structure/Environment
Database System Structure/Environment
1. Query Processor:
It interprets the requests (queries) received from end user via an application
program into instructions. It also executes the user request which is received
from the DML compiler.
Query Processor contains the following components:-
❖ DML Compiler: It processes the DML statements into low level instruction
(machine language), so that they can be executed.
❖ DDL Interpreter: It processes the DDL statements into a set of table
containing meta data (data about data).
❖ Embedded DML Pre-compiler: It processes DML statements embedded in an
application program into procedural calls.
❖ Query Optimizer: It executes the instruction generated by DML Compiler.
Database System Structure/Environment
2. Storage Manager
❖ Storage Manager is a program that provides an interface between the data stored
in the database and the queries received.
❖ It is also known as Database Control System.
❖ It maintains the consistency and integrity of the database by applying the
constraints and executing the DCL statements.
❖ It is responsible for updating, storing, deleting, and retrieving data in the database.
It contains the following components –
❖ Authorization Manager: It ensures role-based access control, i.e,. checks whether
the particular person is privileged to perform the requested operation or not.
❖ Integrity Manager: It checks the integrity constraints when the database is
modified.
❖ Transaction Manager: It controls concurrent access by performing the operations
in a scheduled way that it receives the transaction. Thus, it ensures that the
database remains in the consistent state before and after the execution of a
transaction.
❖ File Manager: It manages the file space and the data structure used to represent
information in the database.
❖ Buffer Manager: It is responsible for cache memory and the transfer of data
between the secondary storage and main memory.
Database System Structure/Environment
3. Disk Storage: It contains the following components:
❖ Data Files: It stores the data.
❖ Data Dictionary: It contains the information about the structure of any database object. It
is the repository of information that governs the metadata.
❖ Indices: It provides faster retrieval of data item.
The structure of a Database Management System (DBMS) can be divided into three main
components: the Internal Level, the Conceptual Level, and the External Level.
❖ Internal Level: This level represents the physical storage of data in the database. It is
responsible for storing and retrieving data from the storage devices, such as hard drives or
solid-state drives. It deals with low-level implementation details such as data compression,
indexing, and storage allocation.
❖ Conceptual Level: This level represents the logical view of the database. It deals with the
overall organization of data in the database and the relationships between them. It defines
the data schema, which includes tables, attributes, and their relationships. The conceptual
level is independent of any specific DBMS and can be implemented using different DBMSs.
❖ External Level: This level represents the user’s view of the database. It deals with how users
access the data in the database. It allows users to view data in a way that makes sense to
them, without worrying about the underlying implementation details. The external level
provides a set of views or interfaces to the database, which are tailored to meet the needs of
specific user groups.
Database System Structure/Environment
The three levels are connected through a schema mapping process that translates
data from one level to another. The schema mapping process ensures that changes
made at one level are reflected in the other levels.
In addition to these three levels, a DBMS also includes a Database Administrator
(DBA) component, which is responsible for managing the database system. The
DBA is responsible for tasks such as database design, security management,
backup and recovery, and performance tuning.
Overall, the structure of a DBMS is designed to provide a high level of abstraction
to users, while still allowing low-level implementation details to be managed
effectively. This allows users to focus on the logical organization of data in the
database, without worrying about the physical storage or implementation details.