You are on page 1of 39

DBMS CONCEPTS AND ARCHITECTURE

LECTURE OUTLINE

• DBMS Architectures
• Types of DBMS Architectures
• Data Abstraction
• Database schema
• Database Instance
• Data Independence
• Data Models
DBMS Architecture
 The architecture of DBMS depends on the
computer system on which it runs.
 For example, in a client-server DBMS
architecture, the database systems at server
machine can run several requests made by
client machine. We will understand this
communication with the help of diagrams.
Types of DBMS Architecture

There are three types of DBMS architecture:


1. Single tier architecture
2. Two tier architecture
3. Three tier architecture
Single tier architecture

• In this type of architecture, the database is readily


available on the client machine, any request made by client
doesn’t require a network connection to perform the
action on the database.
• For example, lets say you want to fetch the records of
employee from the database and the database is available
on your computer system, so the request to fetch
employee details will be done by your computer and the
records will be fetched from the database by your
computer as well. This type of system is generally referred
as local database system.
Two tier architecture
Two tier architecture

• In two-tier architecture, the Database system is present at


the server machine and the DBMS application is present at
the client machine, these two machines are connected
with each other through a reliable network.
• Whenever client machine makes a request to access the
database present at server using a query language like sql,
the server perform the request on the database and
returns the result back to the client. The application
connection interface such as JDBC(java database
connectivity), ODBC(open database connectivity) are used
for the interaction between server and client.
Three tier architecture
Three tier architecture

• In three-tier architecture, another layer is present between


the client machine and server machine.
• In this architecture, the client application doesn’t
communicate directly with the database systems present
at the server machine, rather the client application
communicates with server application and the server
application internally communicates with the database
system present at the server.
Data Abstraction

Database systems are made-up of complex data structures. To


ease the user interaction with database, the developers hide
internal irrelevant details from users. This process of hiding
irrelevant details from user is called data abstraction.
We have three levels of abstraction:
• Physical level
• Logical level/conceptual level
• View level
DBMS – Three Level Architecture

• This architecture has three levels:


1. External level
2. Conceptual level
3. Internal level
External level

• It is also called view level. The reason this level is called


“view” is because several users can view their desired data
from this level which is internally fetched from database
with the help of conceptual and internal level mapping.
• The user doesn’t need to know the database schema
details such as, table definition. user is only concerned
about data which is what returned back to the view level
after it has been fetched from database (present at the
internal level).
• External level is the “top level” of the Three Level DBMS
Architecture.
Conceptual level

• It is also called logical level. The whole design of the


database such as relationship among data, schema of data
etc. are described in this level.
• Database constraints and security are also implemented in
this level of architecture. This level is maintained by DBA
(database administrator).
• This is the middle level of 3-level data abstraction
architecture. It describes what data is stored in database.
Internal level

• This level is also known as physical level. This level


describes how the data is actually stored in the storage
devices. This level is also responsible for allocating space to
the data. This is the lowest level of the architecture.
Example

Example: Let’s say we are storing customer information in a


customer table.
At physical level these records can be described as blocks of
storage (bytes, gigabytes, terabytes etc.) in memory. These
details are often hidden from the programmers.
At the logical level these records can be described as fields
and attributes along with their data types, their relationship
among each other can be logically implemented. The
programmers generally work at this level because they are
aware of such things about database systems.
At view level, user just interact with system with the help of
GUI and enter the details at the screen.
DBMS Schema

Definition of schema: Design of a database is called the


schema. It only shows the design of the database, it doesn’t
show the data present in those tables. Schema is only a
structural view(design) of a database as shown in the diagram
below.
Schema is of three types:
• Physical schema
• logical schema
• view schema. schema
Types of DBMS Schema

• Physical Database Schema: A physical database schema


specifies how the data is stored physically on a storage
system or disk storage in the form of Files and Indices.
Designing a database at the physical level is called
a physical schema.
• Logical Database Schema: The Logical database schema
specifies all the logical constraints that need to be applied
to the stored data. It defines the views, integrity
constraints.
• View Schema: The view level design of a database is known
as view schema. This schema generally describes the end-
user interaction with the database systems.
Types of DBMS Schema
DBMS Instance

• The data stored in database at a particular moment of time


is called instance of database. 
• Database schema defines the variable declarations in
tables that belong to a particular database; the value of
these variables at a moment of time is called the instance
of that database.
• For example, we have a single table student in the
database, today the table has 100 records, so today the
instance of the database has 100 records. Lets say we are
going to add another 100 records in this table by tomorrow
so the instance of database tomorrow will have 200
records in table.
Data Independence
• Data Independence is
defined as a property of
DBMS that helps you to
change the Database
schema at one level of a
database system without
requiring to change the
schema at the next higher
level.

• There are two ways with which we can have data


independence.
Physical Data Independence
Logical Data Independence
Physical Data Independence
• Physical data independence can be defined as the capacity
to change the internal schema without having to change
the conceptual schema.
• If we do any changes in the storage size of the database
system server, then the Conceptual structure of the
database will not be affected.
• Physical data independence is used to separate conceptual
levels from the internal levels.
• Physical data independence occurs at the logical interface
level.
Physical Data Independence
Examples of changes under Physical Data Independence

• Using a new storage device like Hard Drive or Magnetic


Tapes
• Modifying the file organization technique in the Database
• Modifying indexes.
• Change of Location of Database from say C drive to D Drive
Logical Data Independence
• Logical data independence refers characteristic of being
able to change the conceptual schema without having to
change the external schema.
• Logical data independence is used to separate the external
level from the conceptual view.
• If we do any changes in the conceptual view of the data,
then the user view of the data would not be affected.
• Logical data independence occurs at the user interface
level.
Logical Data Independence
Examples of changes under Logical Data Independence

• Add/Modify/Delete a new attribute, entity or relationship


is possible without a rewrite of existing application
programs
• Merging two records into one
• Breaking an existing record into two or more records
Data Model
• Data Model gives us an idea that how the final system will
look like after its complete implementation.
• It defines the data elements and the relationships between
the data elements.
• Data Models are used to show how data is stored,
connected, accessed and updated in the database
management system.
• Though there are many data models being used nowadays
but the Relational model is the most widely used model.
Types of Data Model
Some of the Data Models in DBMS are:
• Hierarchical Model
• Network Model
• Entity-Relationship Model
• Relational Model
• Object-Oriented Data Model
• Semi-Structured Data Model
Hierarchical Model
• Hierarchical Model was the first DBMS model.
• This model organizes the data in the
hierarchical tree structure.
• The hierarchy starts from the root which has
root data and then it expands in the form of a
tree adding child node to the parent node.
• This model easily represents some of the real-
world relationships like food recipes, sitemap of
a website etc. 
Hierarchical Model
• Example: We can represent the relationship between
the shoes present on a shopping website in the
following way:
Network Model
• This model is an extension of the hierarchical
model.
• It was the most popular model before the
relational model.
• This model is the same as the hierarchical
model, the only difference is that a record can
have more than one parent. It replaces the
hierarchical tree with a graph.
Network Model
• Example: In the example below we can see that node
student has two parents i.e. CSE Department and
Library. This was earlier not possible in the hierarchical
model.
Entity-Relationship Model

• Entity-Relationship Model or simply ER Model is


a high-level data model diagram.
• In this model, we represent the real-world
problem in the pictorial form to make it easy for
the stakeholders to understand.
• It is also very easy for the developers to
understand the system by just looking at the ER
diagram.
• We use the ER diagram as a visual tool to
represent an ER Model.
Components of ER Diagram
Entities: Entity is a real-world thing. It can be a person,
place, or even a concept. Example: Teachers, Students,
Course, Building, Department etc are some of the
entities of a School Management System.

Attributes: An entity contains a real-world property


called attribute. This is the characteristics of that
attribute. Example: The entity teacher has the
property like teacher id, salary, age, etc.

Relationship: Relationship tells how two attributes are


related. Example: Teacher works for a department.
ER Model
Example: In the diagram below, the entities are Teacher and Department. The
attributes of Teacher entity are Teacher_Name, Teacher_id, Age, Salary,
Mobile_Number. The attributes of entity Department entity are Dept_id,
Dept_name. The two entities are connected using the relationship. Here, each
teacher works for a department.
Relational Model

• Relational Model is the most widely used


model. In this model, the data is maintained in
the form of a two-dimensional table.
• All the information is stored in the form of row
and columns.
• The basic structure of a relational model is
tables. So, the tables are also called relations in
the relational model. 
Relational Model

• Example: we have an Employee table.


Object-Oriented Data Model

• The real-world problems are more closely


represented through the object-oriented data
model.
• Here, the objects are nothing but the data
carrying its properties.
• In this model, both the data and relationship are
present in a single structure known as an object.
• In this model, two and more objects are connected
through links. We use this link to relate one object
to other objects.
Object-Oriented Data Model
• Example: we have two objects Employee and Department. The attributes
like Name, Job_title of the employee and the methods which will be
performed by that object are stored as a single object. The two objects are
connected through a common attribute i.e the Department_id and the
communication between these two will be done with the help of this
common id.
Semi-Structured Model

• Semi-structured model is an evolved form of


the relational model.
• We cannot differentiate between data and
schema in this model. 
• The semi-structured data model allows the data
specifications at places where the individual
data items of the same type may have different
attributes sets.
Semi-Structured Model

Example: In this model, some entities may have


missing attributes while others may have an extra
attribute. This model gives flexibility in storing the
data. It also gives flexibility to the
attributes. Example: If we are storing any value in any
attribute then that value can be either atomic value or
a collection of values.

You might also like