UVA DEPARTMENT OF COMPUTER SCIENCEAbstraction-1Data IndependenceDBMS approach- real solution: data abstraction- it is the name of the game in database systems- one copy at one location of all data- access to the data only through DBMS:no application programs directly touch the datauser --- application program --DBMS -- filesuser --- application program --- DBMS offers a stable view of the data, which is notaffected by reformatting or reorganization of data- many different views of the same data are supportedUVA DEPARTMENT OF COMPUTER SCIENCEAbstraction-2Logical and Physical Data OrganizationLogical organization- conceptual or logical format of the data(e.g., employee record has E#, Name, Address)Physical organization- actual structure of the data and all supporting accessstructures (e.g., index)(e.g., employee: E# 32 bitsName 30 bytesAddress 50 bytes)Benefit- application programs must know the logical organizationbut the physical organization is an implementation detailthey need not knowUVA DEPARTMENT OF COMPUTER SCIENCEAbstraction-3DBMS ArchitectureDifferent abstract levels- a widely accepted general architecture for a database- database described by three abstract levels- internal schema (physical database)- conceptual schema (conceptual database)- external schema (view)Objectives- insulation of application programs and data- support of multiple user views- use of schema to store the DB description (mete-data)UVA DEPARTMENT OF COMPUTER SCIENCEAbstraction-4The Three Schema ArchitectureExternal schema- describes a subset of the database that a particularuser group is interested in, according to the formatthe format user wants, and hides the rest- may contain virtual data that is derived from thefiles, but is not explicitly storedConceptual schema- hides the details of physical storage structures andconcentrates on describing entities, data types,relationships, operations, and constraints.Internal schema- describes the physical storage structure of the DB- uses a low-level (physical) data model to describethe complete details of data storage and access pathsUVA DEPARTMENT OF COMPUTER SCIENCEAbstraction-5Three Schema ArchitectureData and meta-data- three schemas are only meta-data (descriptions of data)- data actually exists only at the physical levelMapping- DBMS must transform a request specified on an externalschema into a request against the conceptual schema,and then into the internal schema- requires information in meta-data on how to accomplishthe mapping among various levels- overhead (time-consuming) leading to inefficiencies- few DBMSs have implemented the full three-schemaarchitectureUVA DEPARTMENT OF COMPUTER SCIENCEAbstraction-6Benefits of Three Schema ArchitectureLogical data independence- the capacity to change the conceptual schema withouthaving to change external schema or application prgmsex: Employee (E#, Name, Address, Salary)A view including only E# and Name is not affected bychanges in any other attributes.Physical data independence- the capacity to change the internal schema withouthaving to change the conceptual (or external) schema- internal schema may change to improve the performance(e.g., creating additional access structure)- easier to achieve logical data independence, becauseapplication programs are dependent on logical structuresUVA DEPARTMENT OF COMPUTER SCIENCEAbstraction-7Data ModelsData abstraction- one fundamental characteristic of the database approach- hides details of data storage that are not needed by mostdatabase users and applicationsData model- a set of data structures and conceptual toolsused to describe the structure of a database(data types, relationships, and constraints)- used in the definition of the conceptual,external, and internal schema- must provide means for DB designers to representthe real-world information completely and naturallyUVA DEPARTMENT OF COMPUTER SCIENCEAbstraction-8Data ModelsHigh-level (conceptual) data models- use concepts such as entities, attributes, relationships- object-based models: ER model, OO modelRepresentational (implementation) data models- most frequently used in commercial DBMSs- record-based models: relational, hierarchical, networkLow-level (physical) data models- to describe the details of how data is stored- captures aspects of database system implementation:record structures (fixed/variable length) and ordering,access paths (key indexing), etc.UVA DEPARTMENT OF COMPUTER SCIENCEAbstraction-9Schemas and InstancesIn any data model, it is important to distinguish betweenthe description of the database and the database itself.Database schema (meta-data)- overall description of a database, specified by a setof definitions- specified during database design (not change frequently)- similar to the notion of type definition in programsDatabase instance- current contents of the database (actual data): DB state- may change frequentlyDistinction between database schema and database state- a database just specified (or defined) is in empty state- initial state would be achieved when the data is loaded- DBMS is responsible to ensure every database state is validUVA DEPARTMENT OF COMPUTER SCIENCEAbstraction-10Data Definition and Manipulation LanguagesData definition language (DDL)- not a procedural language- notations for describing the types of entitiesand relationships among entitiesDDL statements −−→data dictionaryData manipulation language (DML)- for accessing and modifying data- non-procedural: specifying "what" to access- procedural: specifying "what" and "how" to get- non-procedural languages could be easy to usebut may not be efficientUVA DEPARTMENT OF COMPUTER SCIENCEAbstraction-11DBMS ClassificationCriteria- data model on which DBMS is based- number of users supported by DBMS: single/multi user- numberof sites: centralized vs distributed- homogeneity: homogeneous vs heterogeneous (federated)- general-purpose vs special-purpose<ex> airline reservation and telephone directory systemson-line transaction precessing (OLTP) systems need tosupport large # of concurrent transactions w/o delaysData model- the main criterion for classification- entity-relationship (ER) model- object-oriented (OO) model- relational, network, hierarchical modelUVA DEPARTMENT OF COMPUTER SCIENCEAbstraction-12Data ModelsER model- popular high-level conceptual model used in DB design- proposed by P. Chen in 1976 (ACM TODS)- perception of real-world consisting of a collection ofentities and relationships among themOO
View Full Document