chap2 three level architecture_2
TRANSCRIPT
-
8/4/2019 CHAP2 Three Level Architecture_2
1/32
Congratulations to all of you World champion
Abhinav Bindra
clinched India's firstever individual gold
medal at the
Olympics, winning
10m air rifle event atthe Beijing Games in
Beijing on Monday. A man from Zirakpur, Punjab.
-
8/4/2019 CHAP2 Three Level Architecture_2
2/32
An early proposal for a standard terminology and general architecture
for database systems was produced in 1971 by the DBTG (Data
Base Task Group) appointed by the Conference on Data Systems and
Languages (CODASYL, 1971). The DBTG recognized the need for a
two level approach with a system view called the schema and user
views called subschema. The American National Standards Institute
(ANSI) recognized the need for a three level approach with a system
catalog.
Three Level Architecture
-
8/4/2019 CHAP2 Three Level Architecture_2
3/32
There are following three levels or layers of DBMS architecture:
External Level
Conceptual Level
Internal Level
-
8/4/2019 CHAP2 Three Level Architecture_2
4/32
Objective of the Three Level Architecture
Each user should be able to access the same data, but have a
different customized view of the data.
Users interaction with the database should be independent ofstorage considerations.
-
8/4/2019 CHAP2 Three Level Architecture_2
5/32
The Database Administrator (DBA) should be able to change thedatabase storage structures without affecting the users views.
The internal structure of the database should be unaffected by
changes to the physical aspects of storage, such as the changeover to a
new storage device.
The DBA should be able to change the conceptual structure of thedatabase without affecting all users.
-
8/4/2019 CHAP2 Three Level Architecture_2
6/32
-
8/4/2019 CHAP2 Three Level Architecture_2
7/32
External Level or View level
It is the users view of the database. This level describes that part of the
database that is relevant to each user. External level is the one, which is
closest to the end users. This level deals with the way in which individual
users view data. Individual users are given different views according to
the users requirement.
External level is also known as the view level. In addition different views
may have different representations of the same data. For example, one
user may view dates in the form (day, month, year), while another may
view dates as (year, month, day).
-
8/4/2019 CHAP2 Three Level Architecture_2
8/32
Conceptual Level or Logical level
It is the community view of the database. This level describes what data
is stored in the database and the relationships among the data. Themiddle level in the three level architecture is the conceptual level.
This level contains the logical structure of the entire database as seen by
the DBA. It is a complete view of the data requirements of the
organization that is independent of any storage considerations. Theconceptual level represents:
All entities, their attributes, and their relationships;
The constraints on the data; Security and integrity information.
.
-
8/4/2019 CHAP2 Three Level Architecture_2
9/32
This level must not contain any storage dependent details. For instance,
the description of an entity should contain only data types of attributes(for example, integer, real, character) and their length (such as the
maximum number of digits or characters), but not any storage
considerations, such as the number of bytes occupied. Conceptual level
is also known as the logical level
-
8/4/2019 CHAP2 Three Level Architecture_2
10/32
Internal Level or Storage level
It is the physical representation of the database on the computer. This
level describes how the data is stored in the database. The internal level
is the one that concerns the way the data are physically stored on thehardware.
The internal level covers the physical implementation of the database to
achieve optimal runtime performance and storage space utilization. It
covers the data structures and file organizations used to store data onstorage devices. It interfaces with the operating system access methods to
place the data on the storage devices, build the indexes, retrieve the data,
and so on.
-
8/4/2019 CHAP2 Three Level Architecture_2
11/32
The internal level is concerned with such things as:
Storage space allocation for data and indexes;
Record descriptions for storage (with stored sizes for data items);
Record placement;
Data compression and data encryption techniques.
There will be only one conceptual view, consisting of the abstract
representation of the database in its entirely. Similarly there will be only
one internal or physical view, representing the total database, as it isphysically stored.
-
8/4/2019 CHAP2 Three Level Architecture_2
12/32
Schema
The overall description of the database is called the Database Schema.
There are three different types of schema in the database corresponding
to each data view of database. In other words, the data views at each of
three levels are described by schema.
A schema is defined as an outline or a plan that describes the
records and relationships existing at the particular level. The External
view is described by means of a schema called external schema that
correspond to different views of the data. Similarly the Conceptual view
is defined by conceptual schema, which describes all the entities,
attributes, and relationship together with integrity constraints. Internal
View is defined by internal schema, which is a complete description ofthe internal model, containing definition of stored records, the methods
of representation, the data fields, and the indexes used.
-
8/4/2019 CHAP2 Three Level Architecture_2
13/32
There is only one conceptual schema and one internal schema per
database. The schema also describes the way in which data elements at
one level can be mapped to the corresponding data elements in the next
level.
Thus, we can say that schema establishes correspondence between the
records and relationships in the two levels. In a relational database, the
schema defines the tables, the fields in each table, and the relationships
between fields and tables. Schema are generally stored in a data
dictionary.
The schema is specified during the database design process and is not
expected to change frequently. However the actual data in the database
may change frequently; The data in the database at any particular point
in time is called a database instance. Therefore, many database instances
can correspond to the same database schema. The schema is sometimes
called the intension of the database, while an instance is called an
extension (or state) of the database.
-
8/4/2019 CHAP2 Three Level Architecture_2
14/32
To understand the difference between the three levels, consider again
the database schema that describes College Database system. If User1
is a Library clerk, the external view would contain only the student
and book information. If User2 is a account office clerk then he/she
may be interested in students detail and fee detail.
-
8/4/2019 CHAP2 Three Level Architecture_2
15/32
-
8/4/2019 CHAP2 Three Level Architecture_2
16/32
Mapping between Views
External/Conceptual Mapping: Each external schema is related to the
conceptual schema by the external/conceptual mapping. A mapping
between the external and conceptual views gives the correspondence
among the records and the relationships of the external and conceptual
views. There is a mapping from a particular logical record in the external
view to one (or more) conceptual record(s) in the conceptual view.
Names of the fields and records, for instance, may be different. A number
of conceptual fields can be combined into a single external field, for
example, Last_Name and First_Name at the conceptual level but Name
at the external level. A given external record could be derived from a
number of conceptual records.
-
8/4/2019 CHAP2 Three Level Architecture_2
17/32
Conceptual/Internal Mapping: Conceptual schema is related to the
internal schema by the conceptual/internal mapping. This enables the
DBMS to find the actual record or combination of records in physical
storage that constitute a logical record in conceptual schema.
Mapping between the conceptual and the internal levels specifies themethod of deriving the conceptual record from the physical database.
-
8/4/2019 CHAP2 Three Level Architecture_2
18/32
Data Independence-Achievement of Layered Architecture of DBMS
There are two kinds of data independence:
Logical data independence
Physical data independence
Logical data independence
Logical data independence indicates that the conceptual schema can bechanged without affecting the existing external schemas. The change
would be absorbed by the mapping between the external and conceptual
levels.
-
8/4/2019 CHAP2 Three Level Architecture_2
19/32
Physical data independence
Physical data independence indicates that the physical storage structures
or devices could be changed without affecting conceptual schema. The
change would be absorbed by the mapping between the conceptual and
internal levels. Physical data independence is achieved by the presence
of the internal level of the database and the mapping or transformation
from the conceptual level of the database to the internal level.
If there is a need to change the file organization or the type of physical
device used as a result of growth in the database or new technology, a
change is required in the conceptual/internal mapping between the
conceptual and internal levels.
The physical data independence criterion requires that the conceptual
level does not specify storage structures or the access methods (indexing,
hashing etc.) used to retrieve the data from the physical storage medium.
-
8/4/2019 CHAP2 Three Level Architecture_2
20/32
The Logical data independence is difficult to achieve than physical data
independence as it requires the flexibility in the design of database andprogrammer has to foresee the future requirements or modifications in
the design.
-
8/4/2019 CHAP2 Three Level Architecture_2
21/32
The Procedure for Database Access
A users request for data is received by the data manager, which
determines the physical record required. The decision as to whichphysical record is needed may require some preliminary consultation of
the database and/or the data dictionary prior to the access of the actual
data itself.
The data manager sends the request for a specific physical record to the
file manager. The file manager decides which physical block of
secondary storage devices contains the required record and sends the
request for the appropriate block to the disk manager. A block is a unit of
physical input/output operations between primary and secondary storage.
The disk manager retrieves the block and sends it to the file manager,
which sends the required record to the data manager.
-
8/4/2019 CHAP2 Three Level Architecture_2
22/32
-
8/4/2019 CHAP2 Three Level Architecture_2
23/32
Functions of Data Base
Administrator Makes decisions concerning the content of the database: It is the
DBAs job to decide exactly what information is to be held in thedatabasein other words, to identify the entities of interest to theenterprise and to identify the information to be recorded about thoseentities.
Plans storage structures and access strategies: The DBA must alsodecide how the data is to be represented in the database, and mustspecify the representation by writing the storage structure definition(using the internal data definition language). In addition, the associatedmapping between the storage structure definition and the conceptualschema must also be specified.
Provides support to users: It is the responsibility of the DBA toprovide support to the users, to ensure that the data they require isavailable, and to write the necessary external schemas (using theappropriate external data definition language). In addition, themapping between any given external schema and the conceptualschema must also be specified.
-
8/4/2019 CHAP2 Three Level Architecture_2
24/32
Functions of Data Base
Administrator Defines security and integrity checks: DBA is responsible for
providing the authorization and authentication checks such that nomalicious users can access database and it must remain protected.DBA must also ensure the integrity of the database.
Interprets backup and recovery strategies: In the event of damageto any portion of the database-caused by human error, say, or a failurein the hardware or supporting operating systemit is essential to beable to repair the data concerned with a minimum of delay and with aslittle effect as possible on the rest of the system. The DBA must defineand implement an appropriate recovery strategy to recover the databasefrom all types of failures.
Monitoring performance and responding to changes inrequirements: The DBA is responsible for so organizing the systemas to get the performance that is best for the enterprise, and formaking the appropriate adjustments as requirements change.
-
8/4/2019 CHAP2 Three Level Architecture_2
25/32
Metadata or Data Dictionary
A metadata (also called the data dictionary) is the data about the data.It is the self-describing nature of the database that provides program-data independence. It is also called as the System Catalog. It holds the
following information about each data element in the databases, itnormally includes:
Name
Type
Range of values
Source
Access authorization Indicates which application programs use the data so that when a
change in a data structure is contemplated, a list of the affectedprograms can be generated.
-
8/4/2019 CHAP2 Three Level Architecture_2
26/32
Active and Passive Data
Dictionaries Data dictionary may be either active or passive. An active data
dictionary (also called integrated data dictionary) is managedautomatically by the database management software. Since active datadictionaries are maintained by the system itself, they are alwaysconsistent with the current structure and definition of the database.Most of the relational database management systems contain activedata dictionaries that can be derived from their system catalog.
The passive data dictionary (also called non-integrated datadictionary) is the one used only for documentation purposes. Passivedictionary is simply a self-contained application. It is managed by theusers of the system and is modified whenever the structure of the
database is changed. Since this modification must be performedmanually by the user, it is possible that the data dictionary will not becurrent with the current structure of the database.
-
8/4/2019 CHAP2 Three Level Architecture_2
27/32
Components of a DBMS
Query processor: The query processortransforms user queries into a series of low-levelinstructions. It is used to interpret the online
users query and convert it into an efficientseries of operations in a form capable of beingsent to the run time data manager for execution.The query processor uses the data dictionary tofind the structure of the relevant portion of the
database and uses this information in modifyingthe query and preparing and optimal plan toaccess the database.
-
8/4/2019 CHAP2 Three Level Architecture_2
28/32
-
8/4/2019 CHAP2 Three Level Architecture_2
29/32
Run time database manager:Run time database manager isthe central software componentof the DBMS, which interfaceswith user-submitted application
programs and queries. Ithandles database access at runtime. It converts operations inusers queries coming directlyvia the query processor orindirectly via an applicationprogram from the users logical
view to a physical file system. Itaccepts queries and examinesthe external and conceptualschemas to determine whatconceptual records are requiredto satisfy the users request.
-
8/4/2019 CHAP2 Three Level Architecture_2
30/32
Run time database manager: Itenforces constraints to maintain theconsistency and integrity of thedata, as well as its security. It alsoperforms backing and recoveryoperations. Run time database
manager is sometimes referred to asthe database control system and hasthe following components:
Authorization control: Theauthorization control module checksthe authorization of users in termsof various privileges to users..
Command processor: The
command processor processes thequeries passed by authorizationcontrol module.
-
8/4/2019 CHAP2 Three Level Architecture_2
31/32
Integrity checker: It checksthe integrity constraints so thatonly valid data can be enteredinto the database.
Query optimizer: The queryoptimizers determine anoptimal strategy for the queryexecution.
Transaction manager: Thetransaction manager ensuresthat the transaction propertiesshould be maintained by thesystem.
Scheduler: It provides anenvironment in which multipleusers can work on same pieceof data at the same time inother words it supportsconcurrency.
-
8/4/2019 CHAP2 Three Level Architecture_2
32/32
Data manager: The datamanager is responsible forthe actual handling of data inthe database. It providesrecovery to the systemwhich that system should beable to recover the data aftersome failure. It includesRecovery manager andBuffer manager. The buffermanager is responsible for
the transfer of data betweenthe main memory andsecondary storage (such asdisk or tape). It is alsoreferred as the cachemanger.