Transcript Chapter 2

Chapter 2
Database Environment
Chuan Li
© Pearson Education 1Limited 1995, 2005
Chapter 2 - Objectives

Purpose of three-level database architecture.

Contents of external, conceptual, and internal levels.

Purpose of external/conceptual and
conceptual/internal mappings.

Meaning of logical and physical data independence.

Distinction between DDL and DML.

A classification of data models.
© Pearson Education 2Limited 1995, 2005
Chapter 2 - Objectives






Purpose/importance of conceptual modeling.
Typical functions and services a DBMS should
provide.
Function and importance of system catalog.
Software components of a DBMS.
Meaning of client–server architecture and
advantages of this type of architecture for a
DBMS.
Function and uses of Transaction Processing
Monitors.
© Pearson Education 3Limited 1995, 2005
Chapter 2 - Objectives

Purpose of three-level database architecture.

Contents of external, conceptual, and internal levels.

Purpose of external/conceptual and
conceptual/internal mappings.

Meaning of logical and physical data independence.

Distinction between DDL and DML.

A classification of data models.
© Pearson Education 4Limited 1995, 2005
Objectives of Three-Level
Architecture



All users should be able to access same
data.
A user’s view is immune to changes made
in other views.
Users should not need to know physical
database storage details.
© Pearson Education 5Limited 1995, 2005
Objectives of Three-Level
Architecture



All users should be able to access same
data.
A user’s view is immune to changes made
in other views.
Users should not need to know physical
database storage details.
© Pearson Education 6Limited 1995, 2005
Objectives of Three-Level
Architecture



All users should be able to access same
data.
A user’s view is immune to changes made
in other views.
Users should not need to know physical
database storage details.
© Pearson Education 7Limited 1995, 2005
Objectives of Three-Level
Architecture



DBA should be able to change database
storage structures without affecting the
users’ views.
Internal structure of database should be
unaffected by changes to physical aspects of
storage.
DBA should be able to change conceptual
structure of database without affecting all
users.
© Pearson Education 8Limited 1995, 2005
Objectives of Three-Level
Architecture



DBA should be able to change database
storage structures without affecting the
users’ views.
Internal structure of database should be
unaffected by changes to physical aspects of
storage.
DBA should be able to change conceptual
structure of database without affecting all
users.
© Pearson Education 9Limited 1995, 2005
Objectives of Three-Level
Architecture



DBA should be able to change database
storage structures without affecting the
users’ views.
Internal structure of database should be
unaffected by changes to physical aspects of
storage.
DBA should be able to change conceptual
structure of database without affecting all
users.
© Pearson Education10
Limited 1995, 2005
Chapter 2 - Objectives

Purpose of three-level database architecture.

Contents of external, conceptual, and internal levels.

Purpose of external/conceptual and
conceptual/internal mappings.

Meaning of logical and physical data independence.

Distinction between DDL and DML.

A classification of data models.
© Pearson Education11
Limited 1995, 2005
ANSI-SPARC
Architecture
Three-Level
We need to get familiarized with
such organizations…
Very important
American National Standard
Institute on System Planning
and Requirement Committee
© Pearson Education12
Limited 1995, 2005
ANSI-SPARC
Architecture
Three-Level
3-level Design intends to offer
More flexibility
and more usability
E.g, why we need a
representative for DB class?
The same is true…
Divide and conquer
in system design
© Pearson Education13
Limited 1995, 2005
ANSI-SPARC Three-Level
Architecture

Describes what is concerned by
External Level
the users,
 Users’ view of the database.
Which is usually part of logical
schema…
 Describes that part of database
that is
relevant to a particular user.

E.g, in the student – course
scenario.
Conceptual Level Student manager wants to see
 Community view of the database.
student, while
 Describes what data
is stored
in database
Course
manager
wants to see
and relationships among the course…
data.
© Pearson Education14
Limited 1995, 2005
ANSI-SPARC Three-Level
Architecture

Describes the overall situation
External Level
of what data is like…
 Users’ view of the database.
which is common to all users or
applications
logical
 Describes that part of
databaseinthat
is level …
relevant to a particular user.

E.g, in the student – course
scenario.
Conceptual Level
The student, course, and
 Community view of the database.
student-course tables schema
 Describes what data isremains
stored the
in database
same to all
and relationships among
the or
data.
managers
users no matter
what they want individually…
© Pearson Education15
Limited 1995, 2005
ANSI-SPARC Three-Level
Architecture

Describes how data is stored or
represented in DB…
Internal Level
which is schema or description
 Physical representation of the database on
in physical level …

the computer.
E.g, is
in stored
the student
– course
Describes how the data
in the
scenario.
database.
The student table is indexed
with clustering …
while course, and studentcourse tables uses unique
index,…
© Pearson Education16
Limited 1995, 2005
Differences between Three Levels of
ANSI-SPARC Architecture
Let’s see another scenario…
© Pearson Education17
Limited 1995, 2005
Differences between Three Levels of
ANSI-SPARC Architecture
Here, User1 wants to see the
information about staff…
Staff No.
Staff name
Staff age
Staff salary
External view1 extracts them…
© Pearson Education18
Limited 1995, 2005
Differences between Three Levels of
ANSI-SPARC Architecture
Here, User2 wants to see the
information about staff-branch
relationship…
Which staff works in which
branch…
External view2 extracts them…
© Pearson Education19
Limited 1995, 2005
Differences between Three Levels of
ANSI-SPARC Architecture
We come to conceptual level
and notice that it contains all
the information needed and
remains the same to all users…
Information about staff, and
their branch No. …
Requires very careful design…
© Pearson Education20
Limited 1995, 2005
Differences between Three Levels of
ANSI-SPARC Architecture
When we move on to internal
level we notice
it talks a lot in physical
structure, like pointers, indexes
types applied, etc.
Description about how data is
stored … while still notices that
it is only description also
logically existence…
© Pearson Education21
Limited 1995, 2005
Chapter 2 - Objectives

Purpose of three-level database architecture.

Contents of external, conceptual, and internal levels.

Purpose of external/conceptual and
conceptual/internal mappings.

Meaning of logical and physical data independence.

Distinction between DDL and
DML.
More
importantly, let’s see the

mappings between them…
A classification of data models.
© Pearson Education22
Limited 1995, 2005
Data Independence and the ANSISPARC Three-Level Architecture
There are two kinds of inter-level
mappings…
external/conceptual mapping…
and
conceptual/internal mapping…
They all serve to particular kind
of data independence…
© Pearson Education23
Limited 1995, 2005
Differences between Three Levels of
ANSI-SPARC Architecture
When the conceptual level
changes…
Let’s say, we adds attribute
‘data of employment’…
should the external view remain
unchanged?
© Pearson Education24
Limited 1995, 2005
Differences between Three Levels of
ANSI-SPARC Architecture
Yes, it can, however, we have to
change the external/conceptual
mapping a bit…
In order to screen the
conceptual level changes
Therefore, the external view
remain unchanged, so are the
applications working on it…
© Pearson Education25
Limited 1995, 2005
Logical data independence
Differences between Three Levels of
ANSI-SPARC Architecture
When the internal level
changes…
Let’s say, we reorganizes staff
table in sequential files, not
linked files, like now…
should the external view remain
© Pearson Education26
Limited 1995, 2005
unchanged?
Differences between Three Levels of
ANSI-SPARC Architecture
Yes, it can, however, we have to
change the conceptual/internal
mapping a bit…
In order to screen the internal
level changes
Therefore, the external view
remain unchanged, so are the
applications working on it…
Physical data independence
© Pearson Education27
Limited 1995, 2005
Chapter 2 - Objectives

Purpose of three-level database architecture.

Contents of external, conceptual, and internal levels.

Purpose of external/conceptual and
conceptual/internal mappings.

Meaning of logical and physical data independence.

Now, let’s see the formal
Distinction between DDL and DML.

meaning of logical and physical
A classification of data models. data independence…
© Pearson Education28
Limited 1995, 2005
Data Independence

Logical Data Independence



Refers to immunity of external schemas to
changes in conceptual schema.
Conceptual schema changes (e.g.
addition/removal of entities).
Should not require changes to external
schema or rewrites of application programs.
Simply put, external schema is
independent to conceptual
schema…
© Pearson Education29
Limited 1995, 2005
Data Independence

Physical Data Independence



Refers to immunity of conceptual schema to
changes in the internal schema.
Internal schema changes (e.g. using different
file organizations, storage structures/devices).
Should not require change to conceptual or
external schemas.
Simply put, external schema is
independent to internal
schema…
© Pearson Education30
Limited 1995, 2005
Chapter 2 - Objectives


Purpose of three-level databaseWearchitecture.
have covered DB
architecture
operations…
Contents of external, conceptual,
andand
internal
levels.

They are defined in different
Purpose of external/conceptualways…
and DDL and DML
Now, let’s see the difference…
conceptual/internal mappings.

Meaning of logical and physical data independence.

Distinction between DDL and DML.

A classification of data models.
© Pearson Education31
Limited 1995, 2005
Database Languages

Data Definition Language (DDL)


Allows the DBA or user to describe and
name entities, attributes, and relationships
required for the application
plus any associated integrity and security
constraints.
DDL is the tool to define the
data world in DB scope…
Technically, you can define
schema, DB, table, attribute,
constraints, index, …
© Pearson Education32
Limited domain,
1995, 2005
Database Languages

Data Manipulation Language (DML)

Provides basic data manipulation operations
on data held in the database.
DML is the tool to operate the
data world in DB scope…
Technically, you can define
schema, DB, table, attribute,
constraints, index, …
© Pearson Education33
Limited domain,
1995, 2005
Chapter 2 - Objectives

Purpose of three-level database architecture.

Databases
built onlevels.
top of
Contents of external, conceptual,
andare
internal

certain data models.
Purpose of external/conceptual
and
Now,
let’s see about it…
conceptual/internal mappings.

Meaning of logical and physical data independence.

Distinction between DDL and DML.

A classification of data models.
© Pearson Education34
Limited 1995, 2005
Data Model

Purpose


The most important data models include:




To represent data in an understandable way.
Relational Model
Hierarchical Model
Network Model
Data Model comprises:



Data Model is the abstracted
description of realistic things…
a structural part;
Data Model capture the key
a manipulative part;
attributes of the objective
possibly a set of integrity rules
things…
© Pearson Education35
Limited 1995, 2005
Data Model

Purpose


The most important data models include:




To represent data in an understandable way.
Relational Model
Hierarchical Model
Network Model
Data Model comprises:



Relational Model has been the
most influential model for the
last decades…
a structural part;
a manipulative part;
possibly a set of integrity rules
© Pearson Education36
Limited 1995, 2005
Data Model

Purpose


The most important data models include:




To represent data in an understandable way.
Relational Model
Hierarchical Model
Network Model
Data Model comprises:



a structural part;
a manipulative part;
possibly a set of integrity rules
Data structure,
Data manipulation, and
Data integrity…
© Pearson Education37
Limited 1995, 2005
Relational Data Model
All entities and relationships are
represented as relations…
Staff, Branch, …
© Pearson Education38
Limited 1995, 2005
Network Data Model
Network structure
Entities information are
represented as record set, and
Relationships as basic level
connections…
Certain branch has
certain staffs…
© Pearson Education39
Limited 1995, 2005
Hierarchical Data Model
Tree-like structure
Entities information are
represented as record set, and
Relationships as basic level
connections…
Certain branch has
certain staffs…
© Pearson Education40
Limited 1995, 2005
Chapter 2 - Objectives






Purpose/importance of conceptual modeling.
Typical functions and services a DBMS should
provide.
Function and importance of system catalog.
Software components of a DBMS.
Meaning of client–server architecture and
advantages of this type ofConceptual
architecture
for logical
a
modeling,
DBMS.
modeling and physical modeling.
Now, let’s
see why it’s
Function and uses of Transaction
Processing
important…
Monitors.
© Pearson Education41
Limited 1995, 2005
Conceptual Modeling




Conceptual schema is the core of a system
supporting all user views.
Should be complete and accurate
representation of an organization’s data
requirements.
Conceptual modelingConceptual
is process
levelofis the core level
in 3 levels architecture…
developing a model of information
use
And it’s the overall logical view
that is independent of implementation
of the entire organization
details.
Result is a conceptual data model.
© Pearson Education42
Limited 1995, 2005
Conceptual Modeling




Conceptual schema is the core of a system
supporting all user views.
Should be complete and accurate
representation of an organization’s data
requirements.
ultimate
Conceptual modelingIt’s
is the
process
ofshared source
of all users!
developing a model of information use
that is independent of implementation
So it should be clean and
complete
details.
Result is a conceptual data model.
© Pearson Education43
Limited 1995, 2005
Conceptual Modeling




Conceptual schema is the core of a system
supporting all user views.
It should provide easy
Should be complete and
accurate
translation
to implementation
and understanding
representation of an organization’s
data
requirements.
Conceptual modeling is process of
developing a model of information use
that is independent of implementation
details.
Result is a conceptual data model.
© Pearson Education44
Limited 1995, 2005
Conceptual Modeling




Conceptual schema is the core of a system
supporting all user views.
Should be complete and accurate
representation of an organization’s data
requirements.
Conceptual modeling is process of
developing a model of information use
that is independent of implementation
details.
Result is a conceptual data model.
© Pearson Education45
Limited 1995, 2005
Chapter 2 - Objectives






Purpose/importance of conceptual modeling.
Typical functions and services a DBMS should
provide.
Function and importance of system catalog.
Software components of a DBMS.
Meaning of client–server architecture and
advantages of this type of architecture for a
DBMS.
What DBMS must do or provide,
let’s see
about it…
Function and uses of Transaction
Processing
Monitors.
© Pearson Education46
Limited 1995, 2005
Functions of a DBMS

Data Storage, Retrieval, and Update.

A User-Accessible Catalog.

Transaction Support.

Concurrency Control Services.

Recovery Services.
© Pearson Education47
Limited 1995, 2005
Functions of a DBMS

Data Storage, Retrieval, and Update.

A User-Accessible Catalog.

Transaction Support.

Concurrency Control Services.

Recovery Services.
© Pearson Education48
Limited 1995, 2005
Functions of a DBMS

Data Storage, Retrieval, and Update.

A User-Accessible Catalog.

Transaction Support.

Concurrency Control Services.

Recovery Services.
© Pearson Education49
Limited 1995, 2005
Functions of a DBMS

Data Storage, Retrieval, and Update.

A User-Accessible Catalog.

Transaction Support.

Concurrency Control Services.

Recovery Services.
© Pearson Education50
Limited 1995, 2005
Functions of a DBMS

Data Storage, Retrieval, and Update.

A User-Accessible Catalog.

Transaction Support.

Concurrency Control Services.

Recovery Services.
© Pearson Education51
Limited 1995, 2005
Functions of a DBMS

Authorization Services.

Support for Data Communication.

Integrity Services.

Services to Promote Data Independence.

Utility Services.
© Pearson Education52
Limited 1995, 2005
Functions of a DBMS

Authorization Services.

Support for Data Communication.

Integrity Services.

Services to Promote Data Independence.

Utility Services.
© Pearson Education53
Limited 1995, 2005
Functions of a DBMS

Authorization Services.

Support for Data Communication.

Integrity Services.

Services to Promote Data Independence.

Utility Services.
© Pearson Education54
Limited 1995, 2005
Functions of a DBMS

Authorization Services.

Support for Data Communication.

Integrity Services.

Services to Promote Data Independence.

Utility Services.
© Pearson Education55
Limited 1995, 2005
Functions of a DBMS

Authorization Services.

Support for Data Communication.

Integrity Services.

Services to Promote Data Independence.

Utility Services.
© Pearson Education56
Limited 1995, 2005
Chapter 2 - Objectives






Purpose/importance of conceptual modeling.
Typical functions and services a DBMS should
provide.
Function and importance of system catalog.
Software components of a DBMS.
Meaning of client–server architecture and
advantages of this type of architecture for a
DBMS.
What is system catalog,
let’s see
about it…
Function and uses of Transaction
Processing
Monitors.
© Pearson Education57
Limited 1995, 2005
System Catalog


Repository of information (metadata)
describing the data in the database.
Typically stores:
One of the fundamental





of DBMS
names, types, and sizes of datacomponents
items;
Data about data…
constraints on the data;
names of authorized users;
data type…
data items accessible by a user and
thestructure…
type of
data
access;
data integrity…
usage statistics.
data security…
data usability…
© Pearson Education58
Limited 1995, 2005
Chapter 2 - Objectives






Purpose/importance of conceptual modeling.
Typical functions and services a DBMS should
provide.
Function and importance of system catalog.
Software components of a DBMS.
Meaning of client–server architecture and
advantages of this type of architecture for a
What tools are embedded with
DBMS.
DBMS,
Function and uses of Transaction
Processing
let’s see
about it…
Monitors.
© Pearson Education59
Limited 1995, 2005
Components of a DBMS
Mainly composed of …
DML processor
QL processor
DDL processor
Database manager
Other components…
© Pearson Education60
Limited 1995, 2005
Components
Manager (DM)
of
Database
Database manager is the most
complex part…
Security, concurrency, recovery,
integrity, optimization,…
61
© Pearson Education Limited 1995, 2005
Chapter 2 - Objectives






Purpose/importance of conceptual modeling.
Typical functions and services a DBMS should
provide.
Function and importance of system catalog.
Software components of a DBMS.
Meaning of client–server architecture and
advantages of this type of architecture for a
DBMS.
Function and uses of Transaction
C/S soundsProcessing
familiar, right?
Monitors.
let’s see about it…
© Pearson Education62
Limited 1995, 2005
Multi-User DBMS Architectures

Teleprocessing

File-server

Client-server
The incipient stage…
Terminals are connected to DB
via wires
They are not independent…
© Pearson Education63
Limited 1995, 2005
Multi-User DBMS Architectures

Teleprocessing

File-server

Client-server
The intermediate stage…
Workstations are auto and
isolated systems work with DB
via LANs
File-based sharing…
© Pearson Education64
Limited 1995, 2005
Multi-User DBMS Architectures

Teleprocessing

File-server
The sophisticated stage…

Client-server
Clients are auto and isolated
systems running only
applications…
Communicating with DB via
Internet…
© Pearson Education65
Limited 1995, 2005
Teleprocessing

Traditional architecture.
Single mainframe with a number
of terminals attached…
66
© Pearson Education Limited 1995, 2005
File-Server Architecture
Single mainframe with a number
of terminals attached…
© Pearson Education67
Limited 1995, 2005
Traditional Two-Tier ClientServer

Client (tier 1) manages user interface and
runs applications.
Server (tier 2) holds database and DBMS.

Advantages include:






wider access to existing databases;
increased performance;
possible reduction in hardware costs;
reduction in communication costs;
increased consistency.
© Pearson Education68
Limited 1995, 2005
Traditional
Server
Two-Tier
Client-
Significant network traffic.
Copy of DBMS on each
workstation.
Concurrency, recovery and
integrity control more
complex…
© Pearson Education69
Limited 1995, 2005
Traditional
Server
Two-Tier
Client-
wider access to existing
databases, and increased
performance
possible reduction in
hardware costs, and
reduction in communication
costs,
increased consistency…
© Pearson Education70
Limited 1995, 2005
Chapter 2 - Objectives






Purpose/importance of conceptual modeling.
Typical functions and services a DBMS should
provide.
Function and importance of system catalog.
Software components of a DBMS.
Meaning of client–server architecture and
advantages of this type of architecture for a
DBMS.
Function and uses of Transaction Processing
Monitors.
You have got to know about it…
© Pearson Education71
Limited 1995, 2005
Transaction Processing Monitors

Program that controls data transfer
between clients and servers in order to
provide a consistent environment,
particularly for Online Transaction
Processing (OLTP).
© Pearson Education72
Limited 1995, 2005
TPM as middle tier of 3-tier
client-server
© Pearson Education73
Limited 1995, 2005
Homework


Review Questions
2.3, 2.4, 2.6, 2.7
74
Homework


Review Questions
2.3, 2.4, 2.6, 2.7
75
Thank you !!!
2016/4/11
76
Advanced Topics in Database Technologies