Vous êtes sur la page 1sur 24


COMSATS University, Islamabad

Abbottabad Campus

Computer Science Department

Mukhtiar Zamin,

MS (Computer Science)

Iowa, United States of America mukhtiar@ciit.net.pk

Lecture 3

DBMS Architecture

The Three-Level ANSI-SPARC Architecture

External Level

Conceptual Level

Internal Level

Physical Data Organization

Differences between Three Levels of ANSI-SPARC Architecture

Objectives of Three-Level Architecture

Database Schema

Data Independence

Database Languages

Data Models and Conceptual Modeling

Object Based Data Model

Record-based Data Models

Physical Data Models

Conceptual Modeling

DBMS Architecture

A major aim of a database system is to provide users

with an abstract view of data, hiding certain details of

how data is stored and manipulated.

The starting point for the design of a database must be an abstract and general description of the information

requirements of the organization that is to be

represented in the database.

A database is a shared resource, each user may require a different view of the data held in the database. To satisfy

these needs, the architecture of most commercial

DBMSs available today is based to some extent on the so-called ANSI-SPARC architecture.

The Three-Level ANSI-SPARC Architecture

The American National Standards Institute (ANSI) Standards

Planning and Requirements Committee (SPARC) produced this

architecture in 1975 (ANSI, 1975).

It comprising an external, a conceptual and an internal level

External level: The way users perceive the data

Internal level: The way the DBMS and the operating system perceive the data, where the data is actually stored using the data structures and file

Conceptual level: Provides both the mapping and the desired independence between the external and internal levels.

The objective of the three-level architecture is to separate each

user’s view of the database from the way the database is physically


Lecture 3 - DBMS Architecture, ANSI-SPARC architecture, Objectives, Database Schema, Languages and Data Models


External Level

Describes that part of the database that is relevant to each user.

Users’ view of the database.

Describes that part of database that is relevant to a particular user.

A user may require few attributes and may not need rest of the attributes.

Conceptual Level

Describes what data is stored in database and

relationships among the data. The community view of the database.

It contains logical structure of the database

It represents:

All entities, attributes and their relationships Constraints on data Semantic information about the data Security and integrity of data

It does not concern any storage considerations, such as how many bytes occupied.

Internal Level

Physical representation of the database on the

computer Describes how the data is stored in the database.

It covers following things:

Storage space allocation for data and indexes Record descriptions for storage (size) Record placement Data compression and encryption techniques

Physical Data Organization

Below the internal level is the Physical Level. This level is maintained by the Operating System under the direction of the DBMS. Examples :

Fields are stored contiguously on disk or not.

Differences between Three Levels

of ANSI-SPARC Architecture

Differences between Three Levels of ANSI-SPARC Architecture Lecture 3 - DBMS Architecture, ANSI-SPARC architecture, Objectives, Database

Objectives of Three-Level Architecture

Same data accessible to all users.

A user’s view is immune to changes made in other

views. Hide physical database storage details from users.

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.

Database Schema

The description of overall database is called database schema.

External Schema

Corresponds to different views of data

Conceptual Schema

Describes entities, attributes, relationships and constraints.

Internal Schema

It is a complete description of the internal model, including definitions of records, indexes and hashing functions.

Data Independence

Major objective of three level architecture is to provide data independence.

Upper levels are unaffected when changes are made in the low levels.

There are two kinds of data independences

Logical Data Independence

Refers to immunity of external schemas to changes in conceptual schema.

Conceptual schema changes (e.g. addition/removal of


Should not require changes to external schema or rewrites of application programs.

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.

Data Independence

Data Independence Lecture 3 - DBMS Architecture, ANSI-SPARC architecture, Objectives, Database Schema, Languages and Data Models

Database Languages

Consists of two parts a Data Definition Language (DDL) and Data

Manipulation Language (DML).

Do not include constructs for all computing needs such as conditional or iterative statements

Data Definition Language (DDL)

Used to specify the database schema

A language that allows the DBA or user to describe and name the entities, attributes, and relationships required for the application, together with any associated integrity and security constraints.

The result of the compilation of the DDL statements is a set of tables stored in special files collectively called the system catalog. The system catalog integrates the metadata, that is data that describes objects in the database and makes it easier for those objects to be accessed or manipulated.

CREATE database MyDatabaseName OR CREATE TABLE Employee (ID int NOT NULL, LoginID nvarchar(100) NOT NULL, JobTitle nvarchar(200) NOT NULL, …. )

Data Manipulation Language (DML)

A language that provides a set of operations to support the basic data

manipulation operations on the data held in the database.

Data manipulation operations include:




SELECT * FROM Employee





Procedural DML


Allows user to tell system what data is needed and exactly how to retrieve data.

Retrieves a record, processes it and, based on the results, retrieves another record that would be processed similarly, and so on.

Non-Procedural DML


Allows user to state what data is needed rather than how it is to be retrieved.

Single retrieval or update statement.

Data Models

A model is a representation of ‘real world’ objects and events, and their associations.

Data Model


Integrated collection of concepts for describing data, relationships between data, and


constraints on the data in an organization.



Graphical systems used to capture the nature and relationships among data

The purpose of a data model is to represent data and to make the data understandable. If it does this, then it can be easily used to design a database.

Categories of data models include:




Describe Data at internal level

Both object and record based describe Data at Conceptual and External Levels

Object Based Data Model

Object based models use concepts like entities, attributes and relationships

Some of the more common types of object-based data

model are:

EntityRelationship Model

Forms the basis for the database design methodology

Semantic Model Functional Model Object-Oriented Model

Entity is a distinct object such as a person, thing, place etc in the organization that is to be represented.

Attribute is the property that describe some aspects of the entity.

Relationship is an association between entities.

Record-based Data Models

In this model, database consists of a number of fixed format records

and each record has a fixed number of fields.

There are three principal types of record-based logical data model

Relational model Network model Hierarchical model.

The hierarchical and network data models were developed almost a decade before the relational data model, so their links to traditional file processing concepts are more evident.

Record-based Data Models

Relational Data Model

• • • This model is based on mathematical relations. Data and Relationships are represented by
This model is based on mathematical relations.
Data and Relationships are represented by tables
Each table has a number of columns with unique names.

Record-based Data Models

Network Data Model

• • Data is represented as collection of records and relationships are represented as sets. These
Data is represented as collection of records and relationships are represented as sets.
These sets become pointers in the implementations.
Records are organized as graph structures
Nodes are records
Sets as edges

Record-based Data Models

Hierarchical Data Model

• • • Restricted type of Network Model Data is represented as collection of records and
Restricted type of Network Model
Data is represented as collection of records and relationships are represented as sets.
It allows a node to have only one parent
It is represented by a tree graph
Records as nodes also called Segments
Sets as Edges

Physical Data Models

Describe how data is stored in the computer, representing information such as record structures, record orderings, and access paths.


Conceptual Modeling

In three-level architecture, we see that the conceptual schema is the ‘heart’ of the database. The process of constructing a model of the information use in an enterprise that is independent of implementation details, such as the target DBMS, application programs, programming languages, or any other physical considerations. Also referred to as logical models in the literature