380 likes | 579 Views
Chapter 17. Database Environment. 1. Chapter 17 - Objectives. The purpose and origin of the three-level database architecture. The contents of the external, conceptual and internal levels. The purpose of the external/conceptual and the conceptual/internal mappings. 2.
E N D
Chapter 17 Database Environment 1
Chapter 17 - Objectives • The purpose and origin of the three-level database architecture. • The contents of the external, conceptual and internal levels. • The purpose of the external/conceptual and the conceptual/internal mappings. 2
Chapter 17 - Objectives • The meaning of logical and physical data independence. • The distinction between a Data Definition Language (DDL) and a Data Manipulation Language (DML). • A classification of data models. 3
Chapter 17 - Objectives • The purpose and importance of conceptual modeling. • The typical functions and services a DBMS should provide. • The components of a DBMS. 4
Chapter 17 - Objectives • The meaning of the client–server architecture and the advantages of this type of architecture for a DBMS. • The function and importance of the system catalog. 5
Objectives of Three-Level Architecture • All users should be able to access same data. • A user's view is immune to changes made in other views. • Users should not need to know physical database storage details. 6
Objectives of Three-Level Architecture • DBA should be able to change database storage structures without affecting the users' views. • Internal structure of database should be unaffected by changes to physical aspects of storage. • DBA should be able to change conceptual structure of database without affecting all users. 7
ANSI-SPARC Three-level Architecture • External Level • Users' view of the database. Describes that part of database that is relevant to a particular user. • Conceptual Level • Community view of the database. Describes what data is stored in database and relationships among the data. 9
ANSI-SPARC Three-level Architecture • Internal Level • Physical representation of the database on the computer. Describes how the data is stored in the database. 10
An example of the three levels • External level • 01 employee, • 02 employee_city pic x(20), • 02 employee_state pic x(2). • conceptual level • employee • employee_city: varchar(20) • employee_state char(2) • Internal Level • employee • employee_city varchar(20) NULl • employee_state char(2) NOT NULL
Differences between Three Levels of ANSI-SPARC Architecture 11
Data Independence • Logical Data Independence • Refers to immunity of external schemas to changes in conceptual schema. • Conceptual schema changes e.g. addition/removal of entities. • Should not require changes to external schema or rewrites of application programs. 12
Data Independence • Physical Data Independence • Refers to immunity of conceptual schema to changes in the internal schema. • Internal schema changes e.g. using different file organizations, storage structures/devices. • Should not require change to conceptual or external schemas. 13
Data Independence and the ANSI-SPARC Three-level Architecture 14
Data Model • Collection of concepts for describing data, relationships between data and constraints on the data in an organization. • Data Model comprises: • A structural part (a set of rules according to • Which databases can be constructed) • A manipulative part (defining the types of operations that are allowed on the data) • Possibly a set of integrity rules 18
Data Model • Purpose • To represent the data in an understandable way. • Categories of data models include: • Conceptual • Logical (Functional) • Physical 19
Conceptual modeling • The process of developing a conceptual data model that is • a complete and accurate representation of an organization's data requirements. • independent of implementation details. 22
Functions of a DBMS • Data Storage, Retrieval and Update. • Must furnish users with the ability to store, retrieve, and update data in the database. • A User-Accessible Catalog. • Must furnish a catalog in which descriptions of data items are stored and which is accessible to users. 23
Functions of a DBMS • Transaction Support • Must furnish a mechanism to ensure that either all the updates corresponding to a given transaction are made or that none of them are made. • Concurrency Control Services • Must furnish a mechanism to ensure that database is updated correctly when multiple users are updating the database concurrently. 24
Functions of a DBMS • Recovery Services • Must furnish a mechanism for recovering the database in the event that the database is damaged in any way. • Authorization Services • Must furnish a mechanism to ensure that only authorized users can access the database. 25
Functions of a DBMS • Support for Data Communication • Must be capable of integrating with communication software. • Integrity Services • Must furnish a means to ensure that both the data in the database and changes to the data follow certain rules. 26
Functions of a DBMS • Services to Promote Data Independence • Must include facilities to support the independence of programs from the actual structure of the database. • Utility Services • Should provide a set of utility services. 27
Components of a DBMS • Query processor • Database manager (DM) • File manager • DML preprocessor • DDL compiler • Catalog manager 29
Components of Database Manager (DM) • Authorization control • Command processor • Integrity checker • Query optimizer • Transaction manager • Scheduler • Recovery manager • Buffer manager 31
Multi-user DBMS Architectures • Teleprocessing • File-server • Client-server 32
Teleprocessing • Traditional architecture. • Single mainframe with a number of terminals attached. • Trend is now towards downsizing. 33
File-server • File-server is connected to several workstations across a network. • Database resides on file-server. • DBMS and applications run on each workstation. 35
File-server • Disadvantages include: • Significant network traffic. • Copy of DBMS on each workstation. • Concurrency, recovery and integrity control more complex. 36
Client-server • Server holds the database and the DBMS. • Client manages the user interface and runs applications. 38
Client-server • Advantages include: • Wider access to existing databases. • Increased performance. • Possible reduction in hardware costs. • Reduction in communication costs. • Increased consistency. 39
System Catalog • A repository of information (metadata) describing the data in the database. • Typically stores: • Names of authorized users. • Names of data items in the database. • Constraints on each data item. • Data items accessible by a user and the type of access. 43
System Catalog • It is used by modules such as: • Authorization Control. • Integrity Checker. 44