2 - Database System Architecture
2 - Database System Architecture
© A. Abhari Page 2
Data Modeling: Schemas and Instances
• Before start to talk about database architecture
note that in any data model, it is important to
distinguish between
» description of the database (database schema)
» database itself (instance of a database)
• Database schema
Describes the database
Specified during the database design phase
» Not expected to change frequently
Most data models have a notation for graphical
representation of schema
© A. Abhari Page 3
Data Modeling: Schemas and Instances
Example schema: SUPPLIER-PARTS database
© A. Abhari Page 4
Data Modeling: Schemas and Instances
• Database instance
» Refers to the data in the database at a particular moment in
time
» Many database instances can correspond to a particular schema
» Every time we insert, delete, update the value of a data item,
we change one instance of database to another
» DBMS is partially responsible for ensuring that every instance
satisfies
– Structure and constraints specified in the database schema
» See the example instance of SUPPLIER-PARTS database
shown before
© A. Abhari Page 5
Three Levels of Architecture
© A. Abhari Page 6
Three Levels of Architecture
• Internal level: Shows how data are stored inside the
system. It is the closest level to the physical storage. This
level talks about database implementation and describes
such things as file organization and access paths. Note
that relational model has nothing explicit to say
regarding the internal level
• Conceptual level: Deals with the modeling of the whole
database. The conceptual schema of database is defined
in this level
• External level: This level models a user oriented
description of part of the database. The views for
individual users are defined by means of external
schemas in this level
© A. Abhari Page 7
Three Levels of Architecture
© A. Abhari
Page 8
Three Levels of Architecture-Example
Conceptual level
struct EMPLOYEE {
int Empl_No;
Internal level int Branch_No;
char F_name [15];
char L_name [15];
struct date Date_of_Birth;
float Salary;
struct EMPLOYEE *next; //pointer to next employee record
}; index Empl_No; index Branch_No; //define indexes for employees
© A. Abhari Page 9
Mapping
• Mapping is the key for providing data
independence. Here is more explanation on data
independence based on three-level architecture.
• Data independence is the capacity to change the
schema at one level without having to change the
schema at the next higher level
• Two types of data independence are
Logical data independence
Physical data independence
© A. Abhari Page 10
Mapping - Data Independence
• Logical data independence (provided by external/
conceptual mapping)
Ability to modify conceptual schema without changing
– External views
– Application programs
Changes to conceptual schema may be necessary
– Whenever the logical structure of the database changes
Due to changed objectives
Examples
» Adding a data item to schema
– Adding price of a part to PART table
» Adding PROJECT table to the SUPPLIER-PARTS database
© A. Abhari Page 11
Mapping - Data Independence
• Physical data independence (provided by
conceptual/internal mapping)
Ability to modify internal or physical schema without changing
– Conceptual or view level schema
– Application programs
Changes to physical schema may be necessary to
– Improve performance of retrieval or update
» Example: Adding a new index structure on city
• Achieving logical data independence is more difficult than
physical data independence
» Because application programs heavily rely on the logical structure of
the data they access
© A. Abhari Page 12
Database Administrator
© A. Abhari Page 13
DBMS (Languages)
• Users interact with database with data sublanguage
(embedded within a host language) which consists of at
least two types of languages
DDL: To define the database
– Used to define the database
For defining schemas at various levels
– Required in building databases
– DBA and database designers are typical users
– Commonly referred to as data definition language
DML: To manipulate data
– Used to construct and use the database
Facilitates retrieval, insertion, deletion and updates
– Typical users are “End Users”
– Referred to as data manipulation language
© A. Abhari Page 14
Database Management System
© A. Abhari Page 15
Support for System Processes
© A. Abhari Page 16