Download as pdf or txt
Download as pdf or txt
You are on page 1of 25

COMSATS University Islamabad

cuiatd.edu.pk
subexpert.com
Abbottabad Campus
Computer Science Department
subexpert.com

DATABASE SYSTEMS

Lecture 3 - DBMS Architecture and Database Model

Mukhtiar Zamin,
MS (Computer Science)
Iowa, United States of America
mukhtiar@cuiatd.edu.pk

1
ACKNOWLEDFMENT
subexpert.com
Lectures are prepared from the following books:
Text Book:
– Database Systems, A practical approach to Design, Implementation and Management
by Thomas Connolly, 4th edition

Other Books:
– Modern Database Management
by Jeffry A. Hoffer, 10th Edition
– Microsoft SQL Server 2008 Database Development
by Microsoft

In addition there are other examples and code snippets from other sources which are
mentioned on respective slides

2
Lecture 3
• DBMS Architecture
subexpert.com
• 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
3
DBMS Architecture

subexpert.com
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.
4
The Three-Level ANSI-SPARC Architecture
subexpert.com
• 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
represented.

5
External Level
• subexpert.com
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.

6
Conceptual Level
subexpert.com
• 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.

7
Internal Level

subexpert.com
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

8
Physical Data Organization
subexpert.com
• 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.

9
Differences between Three Levels
of ANSI-SPARC Architecture
subexpert.com

10
Objectives of Three-Level Architecture
subexpert.com
• 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.

11
Database Schema
subexpert.com
• 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.

12
Data Independence

subexpert.com
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 entities).
– 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.

13
Data Independence
subexpert.com

14
Database Languages
subexpert.com
• 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

15
Data Definition Language (DDL)
subexpert.com
• 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, …. )

16
Data Manipulation Language (DML)
subexpert.com
• 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:
– Retrieval/Selection
• SELECT * FROM Employee
– Insertion
– Modification
– Deletion
• 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.

17
Data Models
• subexpert.com
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.
OR
– 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:


– Object-based
– Record-based
– Physical.
• Describe Data at internal level
– Both object and record based describe Data at Conceptual and External Levels

18
Object Based Data Model
• subexpert.com
Object based models use concepts like entities, attributes
and relationships
• Some of the more common types of object-based data
model are:
– Entity–Relationship 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.
19
Record-based Data Models
subexpert.com
• 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.

20
Record-based Data Models
subexpert.com
Relational Data Model
• This model is based on mathematical relations.
• Data and Relationships are represented by tables
• Each table has a number of columns with unique names.

21
Record-based Data Models

subexpert.com
Network Data Model
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

22
Record-based Data Models

subexpert.com
Hierarchical Data Model
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

23
Physical Data Models
subexpert.com
• Describe how data is stored in the computer,
representing information such as record
structures, record orderings, and access paths.
There

24
Conceptual Modeling
subexpert.com
• 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

25

You might also like