0% found this document useful (0 votes)
19 views

DB Lec 04

The document discusses the three schema architecture of database management systems including the internal, conceptual, and external schemas. It describes how the three schema architecture supports data independence and program-data independence through logical and physical separation of the database design from user applications and physical storage.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views

DB Lec 04

The document discusses the three schema architecture of database management systems including the internal, conceptual, and external schemas. It describes how the three schema architecture supports data independence and program-data independence through logical and physical separation of the database design from user applications and physical storage.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

1

Database Systems

Three Schema Architecture and Database Management Systems


Data Independence
2

Database Management S
ystems

• Three Schema Architecture


▫ Internal level
▫ Conceptual level
▫ External or view level
• Data independence
▫ Logical data independence
▫ Physical data independence
3

Database Management S
ystems

Three-Schema Architecture
• Proposed to support DBMS characteristics of:
• Program-data independence.
• Support of multiple views of the data.
• Use of a catalog to store the database description
4

Database Management S
ystems

The Three Schema Architecture


5

Database Management S
ystems

Three-Schema Architecture
• Goal is to separate the user application and the
physical database:
• Internal schema
• Conceptual schema
• External schemas
6

Database Management S
ystems

Internal schema
• Internal schema at the internal level to
describe physical storage structures and access
paths. Typically uses a physical data model and
describes the complete detail of the data
storage.
7

Database Management S
ystems

Conceptual schema
• Conceptual schema at the conceptual level to
describe the structure and constraints for the
whole database for a community of users. Uses a
conceptual or an implementation data model
which hides the details of physical storage
structures and concentrates on describing
entities, data types, relationships, user
operations, and constraints i.e. representational
model
8

Database Management S
ystems

External schema
• External schemas at the external or view level
to describe the various user views. Usually uses
the same data model as the conceptual level.
Describes the part of the database that a
particular user group is interested in and hides
the rest of the database from that user group.
9

Differences between Three Levels


of ANSI-SPARC Architecture
10

Database Management S
ystems

Three-Schema Architecture
• three schemas are only descriptions of data; the only data that
actually exists is at the physical level.

• In a DBMS based on the three-schema architecture, each user group


refers only to its own external schema.

• Hence, the DBMS must transform a request specified on an external


schema into a request against the conceptual schema, and then into a
request on the internal schema for processing over the stored
database.

• If the request is a database retrieval, the data extracted from the


stored database must be reformatted to match the user’s external
view.
11

Database Management S
ystems

Three-Schema Architecture
Mappings among schema levels are needed to
transform requests and data. Programs refer to an
external schema, and are mapped by the DBMS to
the internal schema for execution.
• These mappings may be time-consuming, so some
DBMSs-especially those that are meant to support
small databases-do not support external views.
Even in such systems, however, a certain amount
of mapping is necessary to transform requests
between the conceptual and internal levels.
12

Database Management S
ystems

Data Independence
• Defined as capacity to change the schema at one
level of a database system without having to
change the schema at the next higher level.
• We can define two types of Data independence:

• Logical Data Independence

• Physical Data Independence


13

Database Management S
ystems

Logical Data Independence


• Logical Data Independence: The capacity to change
the conceptual schema without having to change the
external schemas and their application programs.
• For example, we may change the conceptual schema to
expand the database (by adding a record type or data
item), to change constraints, or to reduce the database
(by removing a record type or data item). In the last
case, external schemas that refer only to the remaining
data should not be affected.
• Only the view definition and mappings need be changed
in a DBMS that supports logical Data Independence
14

Database Management S
ystems

Logical Data Independence


15

Database Management S
ystems

Physical Data Independence


• Physical Data Independence: The capacity
to change the internal schema without having to
change the conceptual schema. Changes to the
internal schema may be needed because some
physical files had to be reorganized-for example,
by creating additional access structures-to
improve the performance of retrieval or update.
If the same data as before remains in the
database, we should not have to change the
conceptual schema.
16

Database Management S
ystems

Physical Data Independence


17

Database Management S
ystems

Data Independence
• When a schema at a lower level is changed, only the
mappings between this schema and higher-level
schemas need to be changed in a DBMS that fully
supports data independence. The higher-level
schemas themselves are unchanged. Hence, the
application programs referring to the higher-level
schema need not be changed.
• Physical data independence (exact location of data,
hardware details, compression, splitting) exists in
most databases and file environments, however
conceptual data independence is very hard to come
18

Database Management S
ystems

• The three-schema architecture can make it


easier to achieve true data independence, both
physical and logical.
• However, the two levels of mappings create an
overhead during compilation or execution of a
query or program, leading to inefficiencies in the
DBMS. Because of this, few DBMSs have
implemented the full three-schema architecture.

You might also like