Three Tier DBMS Architecture
Three Tier DBMS Architecture
Three Tier DBMS Architecture
The external view is defined by the external schema, the logical view is defined by
the conceptual schema and the internal view is defined by the internal schema. A
database schema is a blueprint of database that defines how data is organized
within a relational database.
User-1 User-2 User-n
External level describes External External External
the data relevant to a View-1 View-2 View-n
particular group of users
External
Level
Disk
1
(i) External or User view Level: The external view describes how the users want
to see the data. This level provides the different data views to different types of
users, so external view may be defined as subset of the stored database. The
external views define the relevant data for application programs and hide the
rest of the database. Therefore, they provide the highest level of database
abstraction.
The mapping from the conceptual level to external level is done by the DBMS
at the run time. When the conceptual schema is modified, the external schema
is not modified but the mapping has to be modified. This is known as logical
data independence.
(ii) Conceptual Level: It describes the logical structure of all the database entities
and the relationships among them. Hence only one conceptual view is defined
and stored for the whole database of any organization.
This view focuses on what data is actually stored in database and relationship
among the data. It also specifies the checks or constraint to retain data
consistency and maintain data integrity.
When the physical schema is modified, the conceptual schema is not modified
but the mapping has to be modified. This is known as physical data
independence.
Example: If students registered in any department then below two entities are
considered & both are related with relationship “registered”.
a. Student (Roll No., Name, Course, Age, DoJ, Address) check Age >17
b. Department (DNo., DNAME, HOD)
2
(iii) Physical (Internal) view: The physical level describes how the data are
stored on disk and it provides the lowest level of data abstraction. The
internal view describes the data structure and file organization for all the
database entities and the access methods to be used by the database.
The three levels of abstraction and the mapping between these levels are
responsible for providing data independence. In other words, data independence
may be defined as the capability of changing one schema without changing the
schema at next higher level.
There are two levels of data independence: Logical data independence and
Physical data independence.
3
(i) Logical data independence: Logical data independence is defined as the
ability to change the conceptual schema without changing the existing
external schema and we need not rewrite the application program.
The external schema describes only that portion of the database in which the
users are interested. The changes made in the logical schema are adjusted by
the mapping provided by the DBMS between the conceptual schema and the
external schema.
The changes made in the internal schema, file organization or the storage
devices are adjusted by the mapping provided by the DBMS between the
internal schema and the conceptual schema.
Data Dictionary: The data dictionary is the mini DBMS that manage a
variety of information such as database structure, set of relationships, data
types, size of data types, constraints, authorizations, etc, about the contents of
the database.
It contains the metadata (a data about data) which provides data independence
in DBMS. Metadata is a complete framework of the database and a database is
maintained separately for it.
4
Data dictionary is the integral part of DBMS and used as an information
repository for metadata and the common code. Hence, the different schemas for
the database can be controlled through the data dictionary.
It provides the central storage of information to the database; therefore, the data
can easily be accessed, inconsistency can be reduced, the constraints can easily
be imposed and data independence can be incorporated.
The DBA provides necessary technical support in creating and maintaining the
database, authorizing access to the database, ensuring security of the database,
etc. so the DBA is responsible for the overall control of the database.
(ii) Defining the physical storage structure: The DBA is authorized for
deciding and modifying the storage structure of the database according
requirement of organization.
(iii) Granting Authorization: DBA has authority to grants the different types of
authorization access of the database to different types of associated users.
5
decides the constraints to be imposed on different entities or attributes to
ensure database integrity.
(i) Data Definition Language (DDL): DDL stands for data definition language
and it is used to define the structures like schema, database, tables, constraints
etc..
The DDL statements are compiled using the DDL compiler, which generates
a set of tables that are stored in data dictionary. Common commands of DDL
statements include CREATE, ALTER, DROP, TRUNCATE etc.
6
ALTER statement: It modifies an existing database object.
TRUNCATE statement: It is used to delete all data from a table. It's much
faster than DELETE
(i) Procedural DML: In this language, the users have to specify not only the
data to be retrieved but also the method (how) to retrieve it. Relational
algebra is an example of procedural DML.
7
(ii) Non-procedural DML: In this language, the users have to specify only the
data to be retrieved without specifying the method (how) to retrieve it.
Relational calculus is an example of non-procedural DML.
The DML statements that request only the retrieval of the data are also
known as query statements. In some DBMS like SQL (Structured Query
Language), the DDL and DML are combined together.