Lecture 02 - Database Architecture
Lecture 02 - Database Architecture
▰ Introduction
▰ Database Architecture Type
▰ Objective of Three Level Architecture
▰ The Three Level Architecture
▰ Data Model
3
Database Architecture types
5
1-tier DBMS Architecture
6
2-tier DBMS Architecture
7
2-tier DBMS Architecture
8
3-tier DBMS Architecture
User
9
3-tier DBMS Architecture
10
Levels of Abstraction
11
3 Levels of Architecture
Lower abstraction
14
3 Levels of Architecture
15
ANSI-SPARC Three-Level
Architecture
16
External View
18
External View
19
Conceptual Model
20
Conceptual Model
21
Conceptual Model
22
Physical Model
23
Physical Model
25
Example 2- Differences between Three Levels
of
ANSI-SPARC Architecture
26
Purpose of Three-Level
Architecture
▰ User’s view
▻ Requirements of each user varies.
▻ All users should be able to access the same
data.
▻ A user’s view is immune to changes made in
other
▻ The user should not need to know physical
database storage details.
27
Purpose of Three-Level
Architecture
▰ DBA’s view
▻ DBA should be able to change database storage
structures without affecting the users’ views.
▻ The internal structure of the database should be
unaffected by changes to physical aspects of
storage.
▻ DBA should be able to change the conceptual
structure of the database without affecting all
users.
28
Mapping
29
Mapping
Conceptual\internal
Mapping
31
External/Conceptual Mapping
32
Instances and Schemas
33
Three Level Architecture
Advantage
Data Independence
34
Data Independence
36
Data Independence
37
Data Independence
Logical Data Independence
38
Data Independence
39
Data Independence
Physical Data Independence
40
Data Independence
Physical Data Independence
41
Data Independence and the ANSI-
SPARC
▰ Three-Level Architecture
42
Model
43
Data Models
▰ Data Model
▻ A collection of concepts that can be used to describe
the structure of a database
▻ By the structure we mean the data types,
relationships, and constraints that should hold on the
data
▻ Also includes basic operations for specifying
retrievals and updates on the database
▻ It is becoming more common to include concepts to
specify the dynamic aspect or behavior of a database
application
44
Parts of Data Model
▰ Structural Part:
▻ It consists of a set of rules. These rules specify how a
database can be developed
▰ Manipulative Part:
▻ It defines the types of operations that can be
performed on data. The operations include updating
or retrieving data from database and changing the
structure of database.
▰ Set of Integrity Rules:
▻ It ensures the accuracy of data in the database.
45
Types of Data Models
46
Logical Data Models
47
Semantics Data Models
48
Entity Relationship (ER) Model
50
Entity Relationship (ER) Model
51
Example 1 - Entity Relationship (ER)
Model: Identify Entities
▰ Case Study
▻ A company has several departments. Each
department has a supervisor and at least one
employee. Employees must be assigned to at least
one, but possibly more departments. At least one
employee is assigned to a project, but an employee
may be on vacation and not assigned to any projects.
▰ Entities:
▻ Company ▻ Employees
▻ Departments ▻ Project
▻ Supervisor
52
Example 2 - Entity Relationship (ER)
Model: Identify Entities
▰ Case study
▻ In a school, a student may be assigned to one or
more posts like perfect, monitor or chairman. A
post must be assigned exactly one student.
▰ Entities:
▻ School
▻ Student
▻ Post
53
Hierarchical Data Model
54
Example 1 - Hierarchical Data
Model
55
Example 2 - Hierarchical Data
Model
56
Network Data Model
58
Relational Data Model
59
Relational Data Model
60
Relational Data Model
61
Example - Relational Data
Model
62
Relational Data Model
▰ Cardinality
▰ Degree
63
JAZAK ALLAH!
Any Question?