You are on page 1of 43

Database Architecture

1
Three Level ANSI-SPARC
Architecture
The model provides the basis for
understanding some of the functionality of
a DBMS.

In 1975 American National Standards


Institute (ANSI) Standards Planning and
Requirement Committee (SPARC)
recognized the need for three level
architecture.

2
Three Level ANSI-SPARC
Architecture-I
Three level architecture
consist of:

1) External Level
2) Conceptual Level
3) Internal Level

3
External Level

The users view of the database. This level


describes that part of the database that is
relevant to each user.
The external level consists of a number of
different external views of the database.
Different views may have different
representation of same data.

4
External Level-II
For example, one user may view dates in
the form (day, month, year), while another
may view dates as (year, month, day).

Some views might include derived or


calculated data. (Example DOB  Age)

5
Conceptual Level
The middle level in the three level
architecture is the conceptual level.
This level describes what data is stored in
the database and the relationships among
the data.
The conceptual level provides both the
mapping and the desired independence
between the external and internal levels.
6
Conceptual Level-I
The conceptual level represents:

1. All entities, their attributes and their


relationships.
2. The constraints on the data.
3. Security and integrity information.

7
Conceptual Level-II
The conceptual level supports each external
view, in that any data available to a user
must be contained in or derivable from the
conceptual level.

However this level must not contain any


storage-dependent details.

8
External and conceptual layers

9
Internal Level
The physical representation of the database
on the computer. This level describes how
the data is stored in the database.

It covers the data structure and file


organizations used to store data on storage
devices.

10
Internal Level-I
The internal level is concerned:

•Storage space allocation for data and


indexes.
•Record descriptions for storage (with stored
sizes for data items).
•Record placement.
•Data compression and data encryption
techniques.
11
Representation of data at different levels of data base
Architecture and at the physical level at bottom
12
Database Schemas
The overall description of the database is
called the database schema.
The schema is specified during the
database design process and is not
expected to change frequently.
There are three different types of schema in
the database. These are defined according
to three level of architecture.
13
External Schema
At the highest level we have multiple
external schemas (also called subschemas)
that correspond to different views of data.

14
Conceptual Schema
At the conceptual level we have conceptual
schema, which describe all the entities,
attributes and relationships together with
integrity constraints.

15
Internal Schema
At lowest level we have internal schema
which is the complete description of internal
model.
Containing the definition of stored record,
the methods of representation, the data
fields and indexes.
There is only one conceptual schema and
one internal schema per database.
16
Mappings
The DBMS is responsible for mapping
between these three types of schema.
It must also check schemas for
consistency.
Each external schema is derivable from
the conceptual schema and it must use
the information in the conceptual
schema to map between each external
schema and the internal schema

17
Mappings-I

The conceptual schema


related to the internal schema
through a conceptual/internal
mapping.

External schema is related to


the conceptual schema by the
external/conceptual mapping.

18
Database Instance
The data in the database at any particular point in
time is called a database instance.
Actual data in database may change frequently.
Therefore many database instances correspond to
the same database schema.
The schema is sometimes called the intension of
the database while an instance is called and
extension or state of the database.

19
Three Level Architecture Objectives
•Each user should be able to access the same
data but have a different customize view of the
data.

•User should not have to deal directly with physical


database storage detail.

•The DBA should be able to change the database


storage structure without affecting the users views.
20
Three Level Architecture Objectives
•The internal structure of the database
should be unaffected by changes to the
physical aspects of storage.

•The DBA should be able to change the


conceptual structure of the database without
affecting all users.

21
Data Independence
A major objective for three-level architecture
is to provide data independence.
Which means that upper levels are
unaffected by changes to lower levels.
Two kinds of data independence:
1)Logical Data Independence
2)Physical Data Independence

22
Logical Data Independence
Logical data independence refers to the immunity
(protection) of the external schemas to changes in
the conceptual schema.
Changes to the conceptual schema such as the
addition or removal of new entities, attributes or
relationships should be possible without having to
change existing external schemas or having
rewrite the application programs.

23
Physical Data Independence
Physical data independence refers to the
immunity of the conceptual schema to
changes in the internal schema.
Changes to the internal schema such as
using different file organizations or storage
structures, using different storage devices,
modifying indexes or hashing algorithms
should be possible without having to change
the conceptual or external schema.

24
Database Languages
A data sublanguage consists of three parts,
1)Data Definition Language (DDL)
2)Data Manipulation Language (DML)
3)Data Control Language (DCL)

These languages are called data sublanguages


because they do not include constructs
(conditional or iterative statements) for all
computing needs, which are provided by HLL.

25
The levels where the Conceptual and Physical data independence are effective

26
Database Languages-I
Many DBMS have a facility for embedding
the sublanguage in a high level
programming language such as COBOL,
Fortran, PASCAL, C, C++, Java, Visual
Basic.

In this case high level language refer to as


the host language.
27
The Data Definition Language
(DDL)
A language that allows the DBA or user to
describe and name the:
Entities
Attributes
Relationships
Integrity and Security Constraints.

28
The Data Manipulation Language
(DML)
Data manipulation operations usually
include the following:
•Insertion of new data into the database
•Modification of data stored in the database
•Retrieval of data contained in the database
•Deletion of data from the database

29
DML Types
Two Types of DML:
1)Procedural DML
2)Non Procedural DML
Procedural language specify how the output of
DML statement must be obtained.
While the non-procedural DMLs describe only
what output to be obtained.
Procedural language treat records individually,
while non-procedural languages operate on set of
records.
30
Functions of DBMS
1) Data Storage, retrieval and update
A DBMS must furnish users with the ability
to store, retrieve and update data in the
database.

2) A user accessible catalog


A DBMS must furnish a catalog in which
descriptions of data items are stored and
which is accessible to users.
31
Functions of DBMS-I
3) Transaction Support
A DBMS must furnish a mechanism which will
ensure that all the updates corresponding to a
given transaction are made or that none of them is
made.

4) Concurrency control services


A DBMS must furnish a mechanism to ensure that
the database is update correctly when multiple
users are updating the database concurrently.
32
Functions of DBMS-II
5) Recovery Services
A DBMS must furnish a mechanism for
recovering the database in the event that the
database is damaged in any way.

6) Authorization Services
A DBMS must furnish a mechanism to
ensure that only authorized users can
access the database.
33
Functions of DBMS-III
7) Support for data communication
A DBMS must be capable of integrating with
communication software.

8) Integrity services
A DBMS must furnish a means to ensure
that both the data in the database and
changes to the data follow certain rules.

34
Functions of DBMS-IV
9) Services to support data
independence

A DBMS must include facilities to support


the independence of programs from the
actual structure of the database.

35
Functions of DBMS-V
10) Utility Services
A DBMS should provide a set of utility
services.
•Import and Export facilities
•Monitoring database facilities
•Examine database performance

36
DBMS Environments
Single User Database Environment
The database environment which supports
only one user accessing the database at a
specific time.
The DBMS might have a number of users
but at a certain time only one user can log
into the database system and use it.
This type of DBMS systems are also called
Desktop Database systems.
37
DBMS Environments-I
Multi-User Database systems
The DBMS which can support a number of
users simultaneously interacting with the
database indifferent ways. A number of
environments exist for such DBMS.
– Teleprocessing
– File Servers
– Client-Server

38
Teleprocessing
 This type of Multi user database systems
processes the user requests at a central
computer.
 All requests are carried to the central
computer where the database is residing,
 Transactions are carried out and the
results transported back to the terminals
(literally dumb terminals).
 It has become obsolete now.
39
File Servers
 This type of multi-user database environment assumes
another approach for sharing of data for different users.

 A file server is used to maintain a connection between


the users of the database system.

 Each client of the network runs its own copy of the


DBMS and the database resides on the file server.

 Now whenever a user needs data from the file server it


makes a request the whole file containing the required
data was sent to the client.

40
File Servers-I

 At this stage it is important to see that the user has


requested one or two records from the database but the
server sends a complete file, which might contain
hundreds of records.

 Now if the client after making the desired operation on


the desired data wants to write back the data on the
database he will have to send the whole file back to the
server, thus causing a lot of network overhead.

 The Good thing about this approach is that the server


does not have lots of actions to do.
41
Client-Server

 This type of multi-user environment is the best


implementation of the network and DBMS environments.

 It has a DBMS server machine which runs the DBMS


and to this machine are connected the clients having
application programs running for each user.

 Once a users wants to perform a certain operation on


data in the database it sends its requests to the DBMS
through its machine’s application software.

42
Client-Server
The request is forwarded to the DBMS
server which performs the required
operation on data in the database stored in
the computer and then passes back the
result to the user intending the result.

This environment is best suited for large


enterprises where bulk of data is processed
and requests are very much frequent.

43

You might also like