+ All Categories
Home > Documents > Mar 4,2008Fatimah Alakeel1 Database Design Chapter-2- Database System Concepts and Architecture...

Mar 4,2008Fatimah Alakeel1 Database Design Chapter-2- Database System Concepts and Architecture...

Date post: 17-Jan-2016
Category:
Upload: kimberly-harmon
View: 219 times
Download: 0 times
Share this document with a friend
Popular Tags:
47
Mar 4,2008 Fatimah Alakeel 1 Database Design Chapter-2- Database System Concepts and Architecture Reference: Prof. Mona Mursi Lecture notes Dr.Lilac Safadi Lecture notes http://www.cse.mrt.ac.lk
Transcript
  • Database DesignChapter-2- Database System Concepts and ArchitectureReference: Prof. Mona Mursi Lecture notesDr.Lilac Safadi Lecture noteshttp://www.cse.mrt.ac.lk

    Fatimah Alakeel

  • Architecture EvolutionDBMS was a tightly integrated systemDBMS now is modular in designwith client- server architectureMainframes replaced by hundredsof distributed computers connected by a network

    Fatimah Alakeel

  • ClientServer ArchitectureClient 1Client 2LANServer(DBMS)DatabaseClient Module Run on user computer Application programs & user interface that access DB Handles user interaction and supports GUIServer Module Handles data storage. Access, search .. ect

    Fatimah Alakeel

  • Data ModelData Abstraction : hiding details of data storage that are not needed by most DB users.Data Model: a collection of concepts used to describe the structure of the DB and a set of operations for specifying retrieval and updates of the DB.DB Structure :Data typesRelationshipsConstraints

    Fatimah Alakeel

  • Categories of Data ModelsHigh Level (Conceptual Data Model)Representational (implementation Data Model)Low Level (Physical Data Model)Provides concepts close to the wayMany users see dataProvides concepts may be understood by end users but are not far from the way the data is organized.(Entities, Attributes, Relationships)Relational Data Model widely usedDetails of how data is stored in the computer. (Computer specialist)(Records format, ordering, access paths : makes the search for a record more efficient)

    Fatimah Alakeel

  • Representational (implementation Data Model)Entity: Represent a real-world objects or concepts. (ex: employee)Attribute: Represent some property of interest that describes an entity. (ex: salary, name)Relationship: among two or more entities. (ex: a works-on relationship between an employee and a project)

    Fatimah Alakeel

  • Database Schema

    Fatimah Alakeel

  • What is DB Schema?A description of the database (meta-data)Covers only some aspectsE.g. name of record type, data items, some constraintsNot changed frequentlySpecify when a new database definedMeta-data = DBMS Catalog

    Schema constructs: Objects in schemaSchema diagram : Convention to display the structure of each record but not the actual instance

    Fatimah Alakeel

  • Schema Diagram STUDENTCOURSEName Student_Number Class MajorC_Name C_Number CreditHours DepartmentNote:Schema diagram displays only some aspects of a schema.Ex: does not show the data types nor the relationship between files.Some conditions can not be represented . EX: students majoring in computer science must take CS1310 before the end of their sophomore year.Schema Construct

    Fatimah Alakeel

  • Instances and SchemaSchemaInstancesThe data storedIn the database at any given timeThe overall designOf the DB

    Fatimah Alakeel

  • Example: University DatabaseDB SchemaA DB InstanceSchema Constructs

    Fatimah Alakeel

  • Three Levels of Database AbstractionPhysical LevelConceptual LevelView 1View 2View 3View N..Physical Schema(files of records or structs) ONLY ONE SCHEMAConceptual SchemaEx: name, account, balanceONLY ONE SCHEMA

    Subschema Part of the schemaControls what info can be seenAS MANY AS NEEDED

    Fatimah Alakeel

  • Database StateDatabase state : the data in the database at particular moment in time. (current set of occurrences or instances).Every insert, delete, update will change the database state.Important difference between database state and database schema.Define a new DB => specify Database schema to the DBMS, At this point the database state is empty state. Database is populated or loaded with data => database state changes. At any time there is a current database state.

    Fatimah Alakeel

  • Database StateValid state: every state of the database satisfies the structure and constraints specified in the schema.The DBMS stores the structure and constraints (meta- data) in the DBMS catalog.

    Schema Evolution : adding another data item to the schema. Ex: adding dateofbirth to the student schema.

    Fatimah Alakeel

  • Database InstancesData in the database at a particular time

    Instance = snapshot = database state ~= current set of occurrences DB_state(i) insert/delete/update DB_state(i+1)

    Fatimah Alakeel

  • Schema, Instances & DB StatesDefine DB schema DB_state(0) = empty stateDB_state(0) populate initial stateDB_state(i) is a valid state for all ISatisfies the structure and the constraints defined in the schema

    DB Schema = intention of the databaseDB state = extension of the Schema

    Fatimah Alakeel

  • Three - Schema Architecture

    Fatimah Alakeel

  • DBMS Architecture and Data IndependenceCharacteristics of database approach:Insulation of program and data (program-data and program-operation independence)Support of multiple user viewsUse of catalog To achieve the previous characteristics => three schema architecture was proposed.The goal was to separate the user applications and the physical database.

    Fatimah Alakeel

  • Visualization of Three-Schema Architecture

    Fatimah Alakeel

    Person 2

    text

    Data

    USER 1

    USER 2

    EXTERNAL VIEW 1

    EXTERNAL VIEW 2

    CONCEPTUAL SCHEMA

    INTERNAL SCHEMA

    END USER

    . . .

    EXTERNAL LEVEL

    CONCEPTUAL LEVEL

    INTERNAL LEVEL

    Conceptual/internal mapping

    External/conceptual mapping

    STORED DATABASE

  • Three-Schema ArchitectureInternal level: describes how data is stored. The way perceived by the DBMS & OS.

    Conceptual level: describes what data stored in DB, and the relationships among the data. The way perceived by the DBA & programmers.

    External level: describes the part of the DB that user is interested in. The way perceived by the end users.

    Fatimah Alakeel

  • Three-Schema Architecture

    Emp_No FName LName Dept_NoStaff_No LName SalaryView 1View 2InternalLevelConceptualLevelEMPLOYEEEmp_NoCHAR(6)FNameCHAR(15)LNameCHAR(15)Dept_NoCHAR(3)SalaryNUMBER(5)

    PREFIXTYPE=BYTE(6),OFFSET=0EMP#TYPE=BYTE(6),OFFSET=6, INDEX=EMPXLNM TYPE=BYTE(15),OFFSET=12FNM TYPE=BYTE(15),OFFSET=27DPT# TYPE=BYTE(4),OFFSET=42PAY TYPE=FULLWORD,OFFSET=46ExternalLevel

    Fatimah Alakeel

  • MappingMapping is the process of transforming requests and results between the Internal, Conceptual & External levels.

    Two types of mapping:- External / Conceptual mapping-Conceptual / Internal mapping

    Fatimah Alakeel

  • DBMS & Three- Schema ArchitectureNot all DBMS support three-schema architecture because: the mapping between the levels require the catalog to be expanded to include information on how to map requests and data among the levels.=> this requires a software to accomplish the mapping.=>may cause overhead during compilation or execution of a query or a program & time consuming.

    Fatimah Alakeel

  • Data Independence

    Fatimah Alakeel

  • Data IndependenceData independence: is the ability to modify a schema definition in one level without affecting a schema definition in the next higher level.

    Two levels of data independence:Logical data independencePhysical data independence

    Fatimah Alakeel

  • Data IndependenceInternalSchemaConceptualSchemaExternalSchemaExternalSchemaExternalSchemaExternal/ConceptualMappingConceptual/InternalMappingLogical data IndependencePhysical data Independence

    Fatimah Alakeel

  • 1- Logical data independenceThe ability to change the conceptual schema without affecting the external schemas. (application programs)Ex: adding/ removing a record or a data itemThe external schema that refer to the remaining data should not be affected.

    Fatimah Alakeel

  • 2- Physical data independenceThe ability to change the internal schema without affecting the conceptual or external schemas. This change might be for reorganizing the physical files. EX: creating new access structures to improve the performance of retrieval or update.( i.e. change in the physical files does not affect the queries)

    Fatimah Alakeel

  • Database Languages

    Fatimah Alakeel

  • Purpose of a Database LanguageDDL (Data Definition Languages)Conceptual schemaInternal schemas (when schema separation is not clear)External schema (in most DBMSs)SDL (Store Definition Languages)Internal schemaVDL (View Definition Languages)External viewDML (Data Manipulation Languages)To manipulate the populated dataModern DB All in one (E.g. SQL)Separate SDL

    Fatimah Alakeel

  • Data Definition Language (DDL)DDL is a descriptive language for defining the database schema

    DDL compiler generates meta-data stored in a the data dictionary

    Fatimah Alakeel

  • Data Manipulation Language (DML)DML is a language for retrieving and updating (insert, delete, & modify) the data in the DB

    Two classes of languages Procedural: user specifies what data is required and how to get those data

    Nonprocedural: user specifies what data is required without specifying how to get those data (e.g. SQL)

    Fatimah Alakeel

  • Database LanguagesDBMS have a facility for embedding DDL & DML (sub-languages) in a High-Level Language (COBOL,PASCAL, C), which in this case is considered a host language.DBMSCall to DBC,C++,Lisp,..Local Vars(memory)ApplicationProgram

    Fatimah Alakeel

  • Where the DML is Used?When DML is embedded in programProgramming Language host languageDML data sub languageFor interactive queriesDML query language

    General usersUser friendly interfaces

    Fatimah Alakeel

  • DBMS InterfacesMenu- basedForm- basedGraphic user interfaceNatural Language interfaceInterface for parametric usersInterfaces for DBA

    Fatimah Alakeel

  • Fatimah Alakeel

  • The Database System Environment

    Fatimah Alakeel

  • Software Components of a DBMSDBMS Component ModulesDatabase System UtilitiesToolsApplication Environments

    Fatimah Alakeel

  • DBMS Component Modules (1/2)

    Fatimah Alakeel

    Data

    COMPILED (CANNED) TRANSACTIONS

    PRIVILEGED COMMANDS

    APPLICATION PROGRAMS

    INTERACTIVE QUERY

    DML STATEMENTS

    Application programmers

    Casual users

    DDL STATEMENTS

    DBA Staff

    Precompiled

    Host Language Compiler

    Query Compiler

    System Catalog/Data Dictionary

    DDL Compiler

    DML Compiler

    Run-time Database Processor

    Stored Data Manager

    Concurrency Control/Backup/Recovery Subsystems

    STORED DATABASE

    execution

    execution

    Parametric users

    execution

  • DBMS Component Modules (2/2)Disk access control OS:DB & catalog are stored on disk .Access to disk is controlled by OS which schedules disk input/output.Stored Data Manager: controls access to DBMS information stored in the disk.CompilersDDL Compiler : process schema definition specified in the DDL, and stores the description of the schema (meta-data) in the DBMS catalog.Query Compiler: handles high- level queries that are entered interactively.DML CompilerPrecompiler /Host language compiler: extracts DML commands from an application program written in a host programming language. These commands are sent to the DML complier for compilation into object code for database access.Handling DB access at runtimeRuntime database processor

    Fatimah Alakeel

  • Database System UtilitiesLoading: load/transfer existing data files (e.g. text files or sequential files) into the database.Backup: backup copy of the database by dumping the entire databases onto tape.File reorganization: to improve performancePerformance Monitoring: monitors database usage and provides statistics to the DBA.

    Fatimah Alakeel

  • ToolsCASE( Computer Aided Software Engineering Tools): used in the design phase of database system. Used by DB designers/DBA/usersExamples:Oracles Designer/DeveloperPowersofts S- Designer tool.Information Engineering Facility (IEF) to implement the ER.Data repository systems (Information repository)Used in large organizations, accessed directly by users or DBAStores : Catalog information (schema, constraints).Design decisions, Usage standards , application program descriptions and user information

    Fatimah Alakeel

  • Application Development EnvironmentsE.g. PowerBuilder/JBuilderSupportsDevelopment of database applicationsDatabase designGUI developmentQuerying and updating Application program development

    Fatimah Alakeel

  • DBMS Classifications

    Fatimah Alakeel

  • DBMS Classification Based on Data ModelRelational data modelHierarchical data modelNetwork data modelExample of network data model

    Fatimah Alakeel

  • DBMS Classification Based on Number of Sites (view of control)

    Centralized systemsDistributed DBMSs (DDBMS)Homogeneous DDBMSHeterogeneous DBMS (Federated DBMS/multi-database systems)

    Fatimah Alakeel

  • Chapter -2- SummaryData ModelDatabase schemaDatabase state, instancesThree Schema ArchitectureMapping Data IndependenceDatabase Languages & InterfacesThe Database System EnvironmentDBMS Classifications

    Fatimah Alakeel


Recommended