![Page 1: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/1.jpg)
Chapter 2
Database System Architecture
![Page 2: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/2.jpg)
An “architecture” for a database system.
A specification of how it will work, what it will “look like.”
The “ANSI/SPARC” architecture provides a model for a general description of database concepts.
![Page 3: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/3.jpg)
Study Group on Database Management
Systems
National Committee on Information
Technology Standards (NCITS)
American National Standards Institute (ANSI)
Standards Planning and Requirements Committee
(SPARC)
Report “DBMS Framework”
1972, 1978
“ANSI”
“ANSI/SPARC” Architecture
“ANSI/SPARC”
“X3”
![Page 4: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/4.jpg)
The Architecture
• Three “levels” of the architecture:
– Internal: How it is physically stored.– External: How it is used, what does it “look
like” to the user (a user).– Conceptual: An abstract specification--
how does it “look” in general, in its entirety.
![Page 5: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/5.jpg)
Fig. 2.1 The three levels of the architecture
![Page 6: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/6.jpg)
Fig. 2.1 The three levels of the architecture
User 1 User 2 User n Each user (or user program) has a different, and partial view of the data.
The “view” of the entire database (as seen by the designer(s) and DBA.
How the data is actually (physically) stored.
![Page 7: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/7.jpg)
Internal level, physical level: the way the data is actually stored.
External level, user logical level: the way the data is seen by each individual user or user program.
Conceptual level, community logical level: the logical view of the entire data structure. Definitions only--no consideration of how used or stored.
![Page 8: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/8.jpg)
External: (Java)
class Employee { String employeeNumber; String departmentNumber; float salary;
} Conceptual: Employee Employee_Number char (6) Department_Number char (4) Salary numeric(5) Internal:
STORED_EMP LENGTH = 18 PREFIX TYPE=BYTE(6), OFFSET=0 EMP# TYPE=BYTE(6), OFFSET=6, INDEX=EMPX DEPT# TYPE=BYTE(4), OFFSET=12, PAY TYPE=FULLWORD, OFFSET=16
Same data, different names
The DBMS ties it all together
![Page 9: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/9.jpg)
At the external level, application programs are written in Java, C++, COBOL, PL/1, Ada, or … (the “host” language).
A data sublanguage is embedded in or interfaced with the program, or used interactively with the DBMS.
The data sublanguage (DSL) of the DBMS is almost universally SQL.
![Page 10: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/10.jpg)
Fig. 2.3 Detailed system architecture
![Page 11: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/11.jpg)
The DBMS provides:
Data Definition Language (DDL)
for the internal
external “schemas”
conceptual
The schemas (plans) are the definitions of how the data is to be stored and how it is to be viewed.
![Page 12: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/12.jpg)
The DBMS provides:
Data Manipulation Language (DML)
for “planned” use
“unplanned” use
.
Planned: operational, production
Unplanned: ad hoc queries, DSS
![Page 13: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/13.jpg)
Embedding:
PL/1 program, DB2 DBMS, DB2-PL/1 pre-compiler
Interfacing:
Java program, any DBMS, JDBC interface
![Page 14: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/14.jpg)
DBMS provides for:
Data Definition
Data Manipulation
Query Capability
with a program or interactively
interactively
SQL is usually the language for all of these
![Page 15: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/15.jpg)
The DBMS provides:
Security enforcement
Integrity checks
Recovery
Concurrency control
Transaction management
Data dictionary
Performance optimization
![Page 16: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/16.jpg)
Data Dictionary
Catalog synonyms
Repository
The “metadata”--data about the data--part of the database (itself a database).
![Page 17: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/17.jpg)
Fig. 2.4 Major DBMS Functions and Components
![Page 18: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/18.jpg)
Logical to Physical Mapping
file
file block disk
block
total disk
space
disk
record 142record 142
record 142record 142
record 142
![Page 19: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/19.jpg)
Logical to Physical Mapping
file
file block disk
block
total disk
space
disk
record 142record 142
record 142record 142
record 142
a table,
part of a table,
multiple tables
![Page 20: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/20.jpg)
Access Methods
• Sequential Access
• Direct Access
• Indexed Access
![Page 21: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/21.jpg)
Access Methods
• Sequential Access
read next write next (append)
(typically either read existing file or write new one)
rewind (go back to the beginning)
generally no read after write
may be able to skip ahead or back
![Page 22: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/22.jpg)
Sequential-access File
![Page 23: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/23.jpg)
Access Methods
• Direct Access– Relative Access, Random Access
read n write n
or, position to n read next write next
(n = relative block number)
must know n (e.g., n is employee number) or calculate n (e.g., n is hashed from employee name)
![Page 24: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/24.jpg)
Access Methods
• Indexed Access
use of an index to find what n is
index is itself a file
if small, can be read and kept in memory
if large, can have an index to the
blocks of the large index
![Page 25: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/25.jpg)
Example of Index and Relative Files
![Page 26: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/26.jpg)
Access Methods
• Sequential Access vs. Direct Access
– Sequential preferable when entire file is to be accessed
– Direct access preferred when access is needed to a few records
– Application determines– Both may be desirable—more difficult to
achieve
![Page 27: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/27.jpg)
The DBMS vendor provides utilities for:
Loading the database (from files).
Unloading/reloading the database for backup.
Reorganization (to improve performance).
Gathering statistics (on usage or performance).
Statistical analysis.
![Page 28: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/28.jpg)
Client/Server Architecture
![Page 29: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/29.jpg)
Fig. 2.5 Client/server architecture
![Page 30: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/30.jpg)
Backends and Frontends
CPUDatabase Network, Users
“backend”
(DB manager)
“frontend”
(DC manager)
“back” “front”
![Page 31: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/31.jpg)
Distributed Processing
![Page 32: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/32.jpg)
Fig. 2.6 Client and server running on different machines
![Page 33: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/33.jpg)
Backends and Frontends
NetworkServer
(DBMS)Client
“backend” “frontend”
![Page 34: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/34.jpg)
Fig. 2.7 One server machine, many client machines
Distributed processing, centralized database
![Page 35: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/35.jpg)
Fig. 2.8 Each machine runs both client(s) and server
Distributed database
![Page 36: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/36.jpg)
“Two-tier” Systems
Application Server
Database Server
Client
same or different computers
network
![Page 37: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/37.jpg)
networkServer
(DBMS)Client
Application Server
Database Server
Client
network
“fat” client
“thin” client
![Page 38: Chapter 2 Database System Architecture. An “architecture” for a database system. A specification of how it will work, what it will “look like.” The “ANSI/SPARC”](https://reader035.vdocument.in/reader035/viewer/2022070408/56649e5c5503460f94b547a6/html5/thumbnails/38.jpg)
2.2 Define the following terms:
back end front end
client host language
conceptual DDL, schema, view load
conceptual/internal mapping logical database design
data definition language internal DDL, schema, view
data dictionary physical database design
data manipulation language planned request
data sublanguage reorganization
DB/DC system server
DC manager storage structure definition
distributed database unload/reload
distributed processing unplanned request
external DDL, schema, view user interface
external/conceptual mapping utility