Vous êtes sur la page 1sur 16

Database Architecture

ANSI-SPARC Architecture
American National Standard
Institute -
Why ?
• Why we need a Standardized
Architecture?
• Three Level Architecture
• At what level we interact with the
system?
• Different Users ( Naïve user,
Designer/Programmer, DBA)
interact at different levels
Main objective: separate the user view

from physical view, Example: DoB



Objectives
1.Separate User View from physical
view
2.Different views of the same data
3.Consolidated representation
4.Both ways easy change

ANSI-SPARC Three-Level Architecture

• Three Schema
• OR Three Models
1.External View = Level – I =
Virtual/Calculated Data
2.Conceptual View= Logical View/
Schema Middle layer = Level - II
3.Internal / Physical View = Level – III
= Bottom Layer (Permanent
Structure of the data)

Three level ANSI -
SPARC Architecture
External External External
Schema 1 User 1 Schema 2 User 2 Schema n User n
External External External ………………...
External
Level View 1 View 2 View n

External/Conceptual
Mapping 1 External/Conceptual
Mapping n
Conceptual
Conceptual Schema Conceptual View
Level

Conceptual/Internal
Mapping

Internal
Level and
physical Internal
data Schema
organisation Internal View
External view
• The users’ view of database
• Presents only the part of database that is relevant
to a particular user / application.
• Consists of a number of different external views of
the database.
• Each consists those entities, attributes and
relationships that the user is interested in.
• Provides different representation of same data
(e.g. date format - dmy, mdy or ddmmyy).
• Derived or calculated data, e.g. date of birth, age
Conceptual view
• The only community view of the database.
• Describes what data is stored in the database and the
relationships among the data.
• Contains the logical structure of the entire database as
seen by the DBA (e.g. listing of full table).
• It represents:
• - all entities, their attributes and relationships
• - the constraints on the data
• - semantic information about the data
• - security and integrity information
• Must not contain any storage-dependent details.
Internal View
• The physical representation of the database on
the computer.
• Describes how the data is stored in the database.
• Physical implementation to achieve optimal run-
time performance and disk space utilization.
• Concern about data structure, file organization,
record placement, data compression and
encryption techniques.
• Some DBMS interfaces with the operating system
access methods.

CONCEPTUAL DESIGN , SCHEMA , LOGICAL
DESIGN
An Example
■ Note that corresponding objects could have
different names at each point
  Example: employee number is referred as:
•  EMPNO in the External view
•  EMPLOYEE_NUMBER in the
conceptual view
•  EMP# in the internal view
■ The system is aware of the correspondences
■ Such correspondences are implemented through
the mappings

Data Independence

■ In a database system it is desirable to allow


applications to be data-independent, because:
  Different applications will need different
views of the same data
  The DBA must have freedom to change the
storage structure or access technique in response
to changing requirements, without having to
modify existing applications
■ If applications are data-dependent, changes in
data storage structure will require corresponding
changes to be made to programs.
■ This would tie up programmer effort to old
applications rather than creating new ones

Data Dictionary
• The result of the compilation of the
DDL statements is a set of tables
stored in special files collectively
called data dictionary.
• The DBMS normally consults the data
dictionary before the actual data is
accessed in the database

COMPONENTS OF DBMS
1) Query Processor:

• Used to transform queries into a series of


low-level instructions directed to the
Database Manager

2) Database Manager:

• The DM interfaces with user-submitted


application programs and queries.
• It accepts the queries and examines the
external and conceptual schema
• Then places a call to the File Manager
Continued… Components of DBMS
3) File Manager:

• It manipulates the underlying storage


files and manages the allocation of
logical storage space on the disk.
• It does not directly manage the physical
input and output of data.
• Rather it passes the requests on the
appropriate access methods, which
either read / write data into the
system buffer.

DBMS Languages
• DDL: Data definition language is used
by the DBA and by the database
designers to define both schemas
(Conceptual and Internal).
• DML : Data manipulation language is
used when the database schemas are
compiled and it is populated with
data. Typical manipulation s include
retrieval, insertion, deletion, and
modifications of the data.
• SDL : Storage definition language is
used to specify the internal schema.
Example: University Database

• Conceptual schema:
– Students(sid: string, name: string, login: string,

age: integer, gpa:real)
– Courses(cid: string, cname:string,
credits:integer)
– Enrolled(sid:string, cid:string, grade:string)
• Physical schema:
– Relations stored as unordered files.
– Index on first column of Students.
• External Schema (View):
– Course_info(cid:string,enrollment:integer)

Vous aimerez peut-être aussi