0% found this document useful (0 votes)
32 views13 pages

4 DBMS Architecture

It

Uploaded by

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

4 DBMS Architecture

It

Uploaded by

Varun Goyal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

DBMS Architecture

o The DBMS design depends upon its architecture. The basic


client/server architecture is used to deal with a large number of PCs,
web servers, database servers and other components that are
connected with networks.
o The client/server architecture consists of many PCs and a
workstation which are connected via the network.
o DBMS architecture depends upon how users are connected to the
database to get their request done.

Types of DBMS Architecture

Database architecture can be seen as a single tier or multi-tier. But


logically, database architecture is of two types like: 2-tier
architecture and 3-tier architecture.

1-Tier Architecture
o In this architecture, the database is directly available to the user. It
means the user can directly sit on the DBMS and uses it.
o Any changes done here will directly be done on the database itself.
It doesn't provide a handy tool for end users.
o The 1-Tier architecture is used for development of the local
application, where programmers can directly communicate with the
database for the quick response.

2-Tier Architecture

o 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. For this
interaction, API's like: ODBC, JDBC are used.
o The user interfaces and application programs are run on the client-
side.
o The server side is responsible to provide the functionalities like:
query processing and transaction management.
o To communicate with the DBMS, client-side application establishes a
connection with the server side.
Fig: 2-tier Architecture

3-Tier Architecture

o The 3-Tier architecture contains another layer between the client


and server. In this architecture, client can't directly communicate
with the server.
o The application on the client-end interacts with an application server
which further communicates with the database system.
o 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.
o The 3-Tier architecture is used in case of large web application.

Fig: 3-tier Architecture

Database Schema
o A database schema is the logical representation of a database,
which shows how the data is stored logically in the entire database.
It contains list of attributes and instruction that informs the
database engine that how the data is organized and how the
elements are related to each other.
o A database schema contains schema objects that may
include tables, fields, packages, views, relationships, primary
key, foreign key,
o In actual, the data is physically stored in files that may be in
unstructured form, but to retrieve it and use it, we need to put it in a
structured form. To do this, a database schema is used. It provides
knowledge about how the data is organized in a database and how
it is associated with other data.
o The schema does not physically contain the data itself;
instead, it gives information about the shape of data and
how it can be related to other tables or models.
o A database schema object includes the following:
o Consistent formatting for all data entries.
o Database objects and unique keys for all data entries.
o Tables with multiple columns, and each column contains its
name and datatype.
o The complexity & the size of the schema vary as per the size of the
project. It helps developers to easily manage and structure the
database before coding it.
o The given diagram is an example of a database schema. It contains
three tables, their data types. This also represents the relationships
between the tables and primary keys as well as foreign keys.
Types of Database Schema
The database schema is divided into three types, which are:

1. Logical Schema
2. Physical Schema
3. View Schema
1. 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.

ADVERTISEMENT

2. 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, and table. Here the term integrity constraints define the
set of rules that are used by DBMS (Database Management System) to
maintain the quality for insertion & update the data. The logical schema
represents how the data is stored in the form of tables and how the
attributes of a table are linked together.

At this level, programmers and administrators work, and the


implementation of the data structure is hidden at this level.

Various tools are used to create a logical database schema, and these
tools demonstrate the relationships between the component of your data;
this process is called ER modelling.

The ER modelling stands for entity-relationship modelling, which specifies


the relationships between different entities.
We can understand it with an example of a basic commerce application.
Below is the schema diagram, the simple ER model representing the
logical flow of transaction in a commerce application.

In the given example, the Ids are given in each circle, and these Ids are
primary key & foreign keys.

The primary key is used to uniquely identify the entry in a document or


record. The Ids of the upper three circles are the primary keys.

The Foreign key is used as the primary key for other tables. The FK
represent the foreign key in the diagram. It relates one table to another
table.

3. 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.

Difference between the Physical and Logical Database Schema

Physical database schema Logical Database schema

It does not include the attributes. It includes the attributes.

It contains both primary & secondary It also contains both primary &
Keys. secondary keys.

It contains the table name. It contains the names of the


tables.

It contains the column names and their It does not contain any column
data types. name or datatype.

Three Layer Schema Design

Advantages of Database Schema


 Providing Consistency of data: Database
schema ensures the data consistency and prevents the
duplicates.
 Maintaining Scalability: Well designed database schema
helps in maintaining addition of new tables in database
along with that it helps in handling large amounts of data in
growing tables.
 Performance Improvement: Database schema helps in
faster data retrieval which is able to reduce operation time
on the database tables.
 Easy Maintenance: Database schema helps in
maintaining the entire database without affecting the rest
of the database.
 Security of Data: Database schema helps in storing the
sensitive data and allows only authorized access to the
database.

Database Instance
The database schema is defined before the actual database is
created, after the database is operational, it is very difficult to
modify the schema because the schema represents the
fundamental structure of the database. Database instance does not
hold any information related to the saved data in database.
Therefore database instance represents the data and information
that is currently stored in the database at a specific point in time.

Database Instance or Database Schema is the


same?
The terms database schema and database instances are related to each
other & sometimes confusing to be used as the same thing. But both are
different from each other.

Database Schema is a representation of a planned database and does


not actually contain the data.

On the other hand, a database instance is a type of snapshot of an


actual database as it existed at an instance of time. Hence it varies or can
be changed as per the time. In contrast, the database schema is static
and very complex to change the structure of a database.

Both instances and schemas are related to and impact each other through
the DBMS. DBMS ensures that every database instance complies with the
constraints imposed by the database designers in the database schema.
Data Independence
o Data independence can be explained using the three-schema
architecture.
o 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.

There are two types of data independence:

1. Logical Data Independence


o Logical data independence refers characteristic of being able to
change the conceptual schema without having to change the
external schema.
o Logical data independence is used to separate the external level
from the conceptual view.
o If we do any changes in the conceptual view of the data, then the
user view of the data would not be affected.
o Logical data independence occurs at the user interface level.

2. Physical Data Independence


o Physical data independence can be defined as the capacity to
change the internal schema without having to change the
conceptual schema.
o 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.
o Physical data independence is used to separate conceptual levels
from the internal levels.
o Physical data independence occurs at the logical interface level.
Fig: Data Independence

Data Models in DBMS


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 Relational Models
1. Conceptual Data Model
2. Representational Data Model
3. Physical Data Model
It is basically classified into 3 types:-

1. Conceptual Data Model


The conceptual data model describes the database at a very high
level and is useful to understand the needs or requirements of the
database. It is this model, that 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.

Characteristics of a conceptual data model


 Offers Organization-wide coverage of the business
concepts.
 This type of Data Models are designed and developed for a
business audience.
 The conceptual model is developed independently of
hardware specifications like data storage capacity, location
or software specifications like DBMS vendor and
technology. The focus is to represent data as a user will
see it in the “real world.”
Conceptual data models known as Domain models create a
common vocabulary for all stakeholders by establishing basic
concepts and scope.

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. 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

3. Physical Data Model


The physical Data Model is used to practically implement
Relational Data Model. 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. In order to come up with a good physical model, we
have to work on the relational model in a better way. Structured
Query Language (SQL) is used to practically implement Relational
Algebra.

This Data Model describes HOW the system will be implemented


using a specific DBMS system. This model is typically created by
DBA and developers. The purpose is actual implementation of the
database.

Characteristics of a physical data model:


 The physical data model describes data need for a single
project or application though it maybe integrated with
other physical data models based on project scope.
 Data Model contains relationships between tables that
which addresses cardinality and nullability of the
relationships.
 Developed for a specific version of a DBMS, location, data
storage or technology to be used in the project.
 Columns should have exact datatypes, lengths assigned
and default values.

You might also like