DB Chapter 2
DB Chapter 2
Halimet A.
e-mail: [email protected]
1
Chapter Two: Database System Architecture
❑ Contents
❖Data models, Schemas, and Instances
❖Architecture and Data Independence
❖Database Language and Interface
❖The Database System Environment
❖Classification of DBMS
2
Data Models
Data Model:
✓ A set of concepts to describe the structure of a
database, the operations for manipulating these
structures, and certain constraints that the database
should obey.
✓ it is a collection of concepts that can be used to describe
the structure of the database including data types,
relationships and the constraints that apply on the data.
✓ The purpose is to represent the data requirements of an
organization in away to make the data readily
understandable by variety of users. 3
Cont…
6
Cont…
A data model must posses the following characteristics so
that the best possible data representation can be obtained.
I. Diagrammatic representation of the data model.
II. Simplicity in designing i.e., Data and their relationships
can be expressed and distinguished easily.
III.Application independent, so that different applications
can share it.
IV.Data representation must be without duplication.
V. Bottom-up approach must be followed.
VI.Consistency and structure validation must be
maintained.
7
Categories of Data Models
Data models can be categorized into three major
categories according to the types of concepts they use to
describe the database structure. These are:
1.Conceptual (high-level, semantic) data models:
✓ Provide concepts that are close to the way many
users perceive data.
✓Example: Entity-Relationship model or object-
Oriented model.
9
Cont…
11
Cont…
12
Cont…
Network Model:
▪ Allows record types to have more that one
parent unlike hierarchical model.
▪ It sees records as set members, each set has an
owner and one or more members.
▪ Allows no many-to-many relationship between
entities.
13
Schemas versus Instances
Database Schema: A schema is plan of the database that
specifies the names of the entities and attributes and the
relationship among them.
▪ It is the overall description of the database. The basic
structure of how the data will be stored in the database is
called schema.
▪ Describes how data is to be structured, defined at design
time.
Schema Diagram: An illustrative display of (most aspects
of) a database schema.
14
Cont…
▪ A schema diagram displays only some aspects of a schema,
such as the names of record types and data items, and some
types of constraints.
Database Instance :
❑ The actual data stored in a database at a particular moment
in time.
❑ It contains all the properties that the schema describes as data
values.
15
Cont…
❑ Also called database instance (or occurrence or snapshot).
✓ The term instance is also applied to individual
database components, e.g., record instance, table
instance, entity instance.
✓ The data in the database at a particular moment of
time is called an instance or a database state.
✓ The instances can be changed by certain CRUD
operations as like addition, deletion of data.
✓ It may be noted that any search query will not make
any kind of changes in the instances
16
Cont…
17
The DBMS Architecture
The Three-Schema Architecture:
▪ The goal of the three-schema architecture is to separate the
user applications and the physical database.
There are three types of schemas in DBMS:
Internal/physical schema, conceptual/logical schema, and
External/view schema.
In this architecture, schemas can be defined at the following
three levels
❖ The internal level has an internal schema, which describes
the physical storage structure of the database.
18
Cont…
19
Cont…
❖ The conceptual level has a conceptual schema, which
describes the structure of the whole database for a
community of users.
❑ The conceptual schema hides the details of physical
storage structures and concentrates on describing
entities, data types, relationships, user operations,
and constraints.
20
Cont…
❖ External schemas at the external level to describe the
various user views.
❑ Usually uses the same data model as the
conceptual schema.
❑ Each external schema describes the part of the
24
Database Architecture
25
Cont…
26
Cont…
1-Tier Architecture
In this architecture, the database is directly available to the user.
✓ It means the user can directly sit on the DBMS and uses it.
27
Cont…
2-Tier Architecture
✓ The 2-Tier architecture is same as basic client-server.
28
Cont…
29
Cont…
3-Tier Architecture
✓ The 3-Tier architecture contains another layer between
the client and server.
✓ In this architecture, client can't directly communicate
with the server.
✓ The application on the client-end interacts with an
application server which further communicates with the
database system.
30
Cont…
31
Data Independence
Data independence can be explained using the three-schema
architecture.
Data independence refers characteristic of being able to
modify the schema at one level of the database system
without altering the schema at the next higher level
We can defined the two types of data independence:
Logical Data Independence:
✓ The capacity to change the conceptual schema without
having to change the external schemas and their
associated application programs.
32
Cont…
33
Cont…
Physical Data Independence:
✓ The capacity to change the internal schema without
having to change the conceptual schema.
✓ Allows to provide logical description of the database
without need of specify physical structure.
✓ For example, the internal schema may be changed when
certain file structures are reorganized, or new indexes are
created to improve database performance.
✓ It used to separate conceptual levels from the internal
levels.
34
Cont…
35
Database Language and Interface
❖ The following five languages are available to specify different
schemas.
37
Cont…
38
Cont…
The DML is of the two types :
1. Procedural DML: It allows the user to tell the system what
data is needed and how to retrieve it.
▪Retrieve data one record-at-a-time;
▪Constructs such as looping are needed to retrieve
multiple records, along with positioning pointers.
2. Non-procedural DML: It allows the user to state what data
are needed, rather than how it is to be retrieved.
▪ For example, the SQL relational language.
▪ Are “set”-oriented and specify what data to retrieve
rather than how to retrieve it.
▪Also called declarative languages.
39
Cont…
43
Cont…
5. Speech Input and Output
✓ The Speech input is detected using predefined words and
used to set up the parameters that are supplied to the
queries.
✓ For output, a similar conversion from text or numbers into
speech takes place.
6. Interfaces for DBA
✓ Most database system contains privileged commands that
can be used only by the DBA’s staff. These include
commands for creating accounts, setting system
parameters, granting account authorization etc.
44
Classification of Database Management Systems
45
Cont…
Based on the data model used
▪ Legacy: Network, Hierarchical.
▪ Currently Used: Relational, Object-oriented, Object-relational,
Entity-Relationship Model, semi-data model,
▪ Recent Technologies: Key-value storage systems, NOSQL
systems: document based, column-based, graph-based and key-
value based.
▪ Native XML DBMSs.
Other classifications(the Number of Users)
▪ Single-user system
48
49