database architecture lecture

Upload: salma-attique

Post on 08-Apr-2018

234 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/7/2019 Database Architecture Lecture

    1/16

    Database Architecture

    ANSI-SPARC Architecture

    American National Standard

    Institute -

  • 8/7/2019 Database Architecture Lecture

    2/16

    Why ?

    Why we need a StandardizedArchitecture?

    Three Level Architecture

    At what level we interact with thesystem?

    Different Users ( Nave user,

    Designer/Programmer, DBA)interact at different levelsMain objective: separate the user view

    from physical view, Example: DoB

  • 8/7/2019 Database Architecture Lecture

    3/16

    Objectives

    1.Separate User View from physicalview

    2.Different views of the same data

    3.Consolidated representation

    4.Both ways easy change

  • 8/7/2019 Database Architecture Lecture

    4/16

    -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 (PermanentStructure of the data)

  • 8/7/2019 Database Architecture Lecture

    5/16

    -Three level ANSISPARC Architecture

    ExternalView 1

    ...ExternalView 2

    ExternalView n

    User 1 User 2 User n

    Conceptual View

    Internal View

    ExternalLevel

    ConceptualLevel

    InternalLevel andphysical

    dataorganisation

    External

    Schema 1

    External

    Schema 2

    External

    Schema n

    ConceptualSchema

    InternalSchema

    External/ConceptualMapping 1 External/Conceptual

    Mapping n

    Conceptual/InternalMapping

  • 8/7/2019 Database Architecture Lecture

    6/16

    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 ofthe database.

    Each consists those entities, attributes andrelationships 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

  • 8/7/2019 Database Architecture Lecture

    7/16

    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.

  • 8/7/2019 Database Architecture Lecture

    8/16

    Internal View

    The physical representation of the database onthe 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 andencryption techniques.

    Some DBMS interfaces with the operating systemaccess methods.

  • 8/7/2019 Database Architecture Lecture

    9/16

    , ,CONCEPTUAL DESIGN SCHEMA LOGICALDESIGN

  • 8/7/2019 Database Architecture Lecture

    10/16

    An Example

    s Note that corresponding objects could havedifferent 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

    s The system is aware of the correspondencess Such correspondences are implemented through

    the mappings

  • 8/7/2019 Database Architecture Lecture

    11/16

    Data Independences 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 thestorage structure or access technique in responseto changing requirements, without having tomodify existing applications

    s If applications are data-dependent, changes in

    data storage structure will require correspondingchanges to be made to programs.s This would tie up programmer effort to old

    applications rather than creating new ones

  • 8/7/2019 Database Architecture Lecture

    12/16

    Data Dictionary

    The result of the compilation of theDDL statements is a set of tablesstored in special files collectively

    called data dictionary. The DBMS normally consults the data

    dictionary before the actual data is

    accessed in the database

  • 8/7/2019 Database Architecture Lecture

    13/16

    COMPONENTS OF DBMS

    1) Query Processor:

    Used to transform queries into a series oflow-level instructions directed to the

    Database Manager2) Database Manager:

    The DM interfaces with user-submittedapplication programs and queries.

    It accepts the queries and examines theexternal and conceptual schema

    Then places a call to the File Manager

  • 8/7/2019 Database Architecture Lecture

    14/16

    Continued Components of DBMS

    3) File Manager:

    It manipulates the underlying storagefiles 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 theappropriate access methods, whicheither read / write data into thesystem buffer.

  • 8/7/2019 Database Architecture Lecture

    15/16

    DBMS Languages

    DDL: Data definition language is usedby the DBA and by the databasedesigners to define both schemas

    (Conceptual and Internal). DML : Data manipulation language isused when the database schemas arecompiled and it is populated with

    data. Typical manipulation s includeretrieval, insertion, deletion, andmodifications of the data.

    SDL : Storage definition language is

    used to specify the internal schema.

  • 8/7/2019 Database Architecture Lecture

    16/16

    :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)