Introduction To DBMS
Introduction To DBMS
DBMS
(Part 2 )
Database Environment
● An Application Program accesses
the database by sending queries or
requests for data to the DBMS
● In Client layer we have several Client machines which can have the access to the database server.
● The API present on the client machine will establish the connection between the machine and the
Database server through JDBC or something else.This is because Clients and Database Server may
● Once this connection gets established,the Interface present on the client machine contains an
Application Program on the back-side which contains a query. This query will be processed by the
Database server and in turn the queried information will be sent to the client machine.
● For example if we query the database to retrieve some information, the query will be Processed by
Database server and that information will be sent to the client by Database server itself.
Three-Tier Client/Server Architecture for DBMS
● An additional layer which acts as an intermediate between Client
layer and Datalayer called Business logic layer.
● Business logic layer is the layer where the Application Programs
are processed.
● Here the Application Programs are processed in the Application
server itself, which makes it different from Two-tier Architecture
where queries are processed in the database server.
● Simply the Client machines will contact Application Server which
in turn processes our Application Programs and fetches the
Required Data from Database and then sends this Information
back to the client machine in the suitable format only.
● https://www.interviewbit.com/blog/dbms-architecture/
Advantages of Three-Tier over Two-Tier
● Even it is easy to maintain Two-Tier Architecture of DBMS it is still not scalable when we
have large number of clients.
● Also not secure because the clients are having direct access to database server.
● Three-Tier Architecture ensures Scalability and Security of the data because of the presence of
this Intermediate layer
● As the Business layer processes the queries and it just retrieves data from server instead of
processing in the server to take place.
● There are n-tier Architectures possible like 4-tier,5-tier and so on…
Data Abstraction provided by DBMS
● One fundamental characteristic of the database approach is that it provides some
level of data abstraction.
● Data abstraction generally refers to the suppression of details of data organization
and storage, and the highlighting of the essential features for an improved
understanding of data.
● One of the main characteristics of the database approach is to support data
abstraction so that different users can perceive data at their preferred level of detail.
● A data model—a collection of concepts that can be used to describe the structure of a
database—provides the necessary means to achieve this abstraction.
● By structure of a database we mean the data types, relationships, and constraints that
apply to the data
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.
Data Model
Key Points :
● Database design is the blueprint for a successful DBMS, ensuring efficient data
organization and retrieval.
● Different models provide varying levels of abstraction and functionality for structuring
data.
● Understanding these models empowers you to choose the best fit for your specific needs.
1. Conceptual Data Model
● High-level or conceptual data models provide concepts that are close to the way many users
perceive data
● It is useful to understand the needs or requirements of the database.
● It is used in the requirement-gathering process i.e. before the Database Designers start making a
particular database. One such popular model is the entity/relationship model (ER model).
● The E/R model specializes in entities, relationships, and even attributes that are used by database
designers.
● In terms of this concept, a discussion can be made even with non-computer science(non-technical)
users and stakeholders, and their requirements can be understood.
Entity-Relationship Model
It is a high-level data model which is used to define the data and the relationships between them. 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.
Entity-Relationship Model
2. Representational Data Model
● This type of data model is used to represent only the logical part of the database and does not
represent the physical structure of the database.
● The representational data model allows us to focus primarily, on the design part of the database. A
popular representational model is a Relational model.
● The relational Model consists of Relational Algebra. In the Relational Model, we basically use
tables to represent our data and the relationships between them. It is a theoretical concept whose
practical implementation is done in Physical Data Model.
● The advantage of using a Representational data model is to provide a foundation to form the base
for the Physical model
● Structured Query Language (SQL) is used to practically implement Relational Algebra.
Representational Data Model
● Hierarchical Model
● Network Model
● Relational Model
● Object-Oriented Model
a) Hierarchical Model
● A hierarchical model represents the data in a tree-like structure in which there is a single parent for each
record.
● Represents one-to-many relationship between parent node and child node.
● These types of models are designed basically for the early mainframe database management systems,
like the Information Management System (IMS) by IBM.
b) Network Model
● Extension of Hierarchical Model
● Data is organised in the form of Graph and are allowed to have more than one
parent node.
● Used to map many-to-many relationships as well
c) Object- Oriented Model
● The need for a data model that more accurately matched the real world became apparent as real-world problems
became more complicated.
● Both data and the data relationships are stored into a single structure that’s known as an object in the
object-oriented data model (or OODM).
● The object-oriented DMS (or Data Management System) is built on top of the OODM (OODBMS).
3. Physical Data Model
● This Data Model describes HOW the data is stored on the computer storage media.
● This model is typically created by DBA and developers. The purpose is actual implementation of
the database.
● Ultimately, all data in a database is stored physically on a secondary storage device such as discs
and tapes. This is stored in the form of files, records, and certain other data structures.
● It has all the information on the format in which the files are present and the structure of the
databases, the presence of external data structures, and their relation to each other.
● Here, we basically save tables in memory so they can be accessed efficiently.
It’s important to distinguish between the
description of the database and the database
itself
Schema
● The description of a database is called the database schema, which is specified
during database design and is not expected to change frequently.
● A schema describes the organization and storage of data in a database and
defines the relationship between various tables.
● A database schema includes descriptive details of the database that can be
depicted through schema diagrams.
● The data in the database at a particular moment in time is called a database
state or snapshot
Schema Diagram
Three Schema Architecture
Three-Schema Architecture
Goal: To separate the user applications from the physical database. In this
architecture, schemas can be defined at the following three levels
1. External Level
2. Conceptual Level
3. Physical Level
Three Schema Architecture
1. External or View Level:
a. This is the highest level of database abstraction which includes a number of external schemas or
user views.
b. It describes the actual view of data that is relevant to the particular user.
c. This level also provides different views of the same database for a specific user or a group of users.
d. An external view provides a powerful and flexible security mechanism by hiding the parts of the
database from a particular user.
2. Conceptual or Logical Level:
a. It has has a conceptual schema, which describes the structure of the whole database.
b. This level acts as a middle layer between the physical storage and user view.
c. It explains what data to be stored in the database, what relationship exists among those data, and
what the constraints and datatypes are. There is only one conceptual schema per database.
3. Internal or Physical Level:
a. It has an internal schema that describes how the data is actually stored in the database and
provides methods to access data from the database.
b. It allows viewing the physical representation of the database on the computer system.
Data Independence
Data independence refers characteristic of being able to modify the schema at
one level of the database system without altering the schema at the next
higher level.