Upload
others
View
5
Download
0
Embed Size (px)
Citation preview
1
Chapter 2
Database Environment
Pearson Education © 2009
2
Chapter 2 - Objectives
Purpose of three-level database architecture.
Contents of external, conceptual, and internal levels.
Purpose of external/conceptual and conceptual/internal mappings.
Meaning of logical and physical data independence.
Distinction between DDL and DML.
A classification of data models.
Pearson Education © 2009
3
Chapter 2 - Objectives
Purpose/importance of conceptual modeling.Typical functions and services a DBMS should provide.Function and importance of system catalog.Software components of a DBMS.Meaning of client–server architecture and advantages of this type of architecture for a DBMS.Function and uses of Transaction Processing Monitors.
Pearson Education © 2009
4
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.
Pearson Education © 2009
5
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.
Pearson Education © 2009
6
ANSI-SPARC Three-Level Architecture
Pearson Education © 2009
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.
Pearson Education © 2009
8
ANSI-SPARC Three-Level Architecture
Internal Level– Physical representation of the database on
the computer. – Describes how the data is stored in the
database.
Pearson Education © 2009
9
Differences between Three Levels of ANSI-SPARC Architecture
Pearson Education © 2009
10
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.
Pearson Education © 2009
11
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.
Pearson Education © 2009
12
Data Independence and the ANSI-SPARC Three-Level Architecture
Pearson Education © 2009
13
Database Languages
Data Definition Language (DDL)– Allows the DBA or user to describe and
name entities, attributes, and relationships required for the application
– plus any associated integrity and security constraints.
Pearson Education © 2009
14
Database Languages
Data Manipulation Language (DML)– Provides basic data manipulation operations
on data held in the database.Procedural DML – allows user to tell system exactly how to
manipulate data.Non-Procedural DML – allows user to state what data is needed
rather than how it is to be retrieved.Fourth Generation Languages (4GLs)
Pearson Education © 2009
15
Data Model
Integrated collection of concepts for describing data, relationships between data, and constraints on the data in an organization.
Data Model comprises:– a structural part;– a manipulative part;– possibly a set of integrity rules.
Pearson Education © 2009
16
Data Model
Purpose– To represent data in an understandable way.
Categories of data models include:– Object-based– Record-based– Physical.
Pearson Education © 2009
17
Data Models
Object-Based Data Models– Entity-Relationship– Semantic– Functional– Object-Oriented.
Record-Based Data Models– Relational Data Model– Network Data Model– Hierarchical Data Model.
Physical Data ModelsPearson Education © 2009
18
Relational Data Model
Pearson Education © 2009
19
Network Data Model
Pearson Education © 2009
20
Hierarchical Data Model
Pearson Education © 2009
21
Conceptual Modeling
Conceptual schema is the core of a system supporting all user views.Should be complete and accurate representation of an organization’s data requirements.
Conceptual modeling is process of developing a model of information use that is independent of implementation details.Result is a conceptual data model.
Pearson Education © 2009
Enterprise Data ModelEnterprise Data Model
•• First step in database developmentFirst step in database development•• Specifies scope and general contentSpecifies scope and general content•• Overall picture of organizational data at high Overall picture of organizational data at high
level of abstractionlevel of abstraction•• EntityEntity--relationship diagramrelationship diagram•• Descriptions of entity typesDescriptions of entity types•• Relationships between entitiesRelationships between entities•• Business rulesBusiness rules
22
23
Figure 2-1 Segment from enterprise data model
Enterprise data model describes the high-level entities in an organization and the relationship between these entities
Information EngineeringInformation Engineering•• A dataA data--oriented methodology to create and oriented methodology to create and
maintain information systemsmaintain information systems•• TopTop--down planningdown planning––a generic IS planning a generic IS planning
methodology for obtaining a broad methodology for obtaining a broad understanding of the IS needed by the entire understanding of the IS needed by the entire organizationorganization
•• Four steps to TopFour steps to Top--Down planning:Down planning:–– PlanningPlanning–– AnalysisAnalysis–– DesignDesign–– ImplementationImplementation
24
25
Identify Strategic Planning Factors Identify Strategic Planning Factors (Table 2(Table 2--2)2)
•• Organization goalsOrganization goals––what we hope to what we hope to accomplishaccomplish
•• Critical success factorsCritical success factors––what MUST work what MUST work in order for us to survivein order for us to survive
•• Problem areasProblem areas––weaknesses we now haveweaknesses we now have
26
Identify Corporate Planning Objects Identify Corporate Planning Objects (Table 2(Table 2--3)3)
•• Organizational unitsOrganizational units––departmentsdepartments•• Organizational locationsOrganizational locations•• Business functionsBusiness functions––groups of business groups of business
processesprocesses•• Entity typesEntity types––the things we are trying to the things we are trying to
model for the databasemodel for the database•• Information systemsInformation systems––application programsapplication programs
27
Develop Enterprise ModelDevelop Enterprise Model
•• Functional decompositionFunctional decomposition–– Iterative process breaking system description Iterative process breaking system description
into finer and finer detailinto finer and finer detail•• Enterprise data model Enterprise data model
•• Planning matrixes Planning matrixes –– Describe interrelationships Describe interrelationships
between planning objectsbetween planning objects
28
29
Planning MatrixesPlanning Matrixes
•• Describe relationships between planning Describe relationships between planning objects in the organizationobjects in the organization
•• Types of matrixes:Types of matrixes:–– LocationLocation--toto--functionfunction–– UnitUnit--toto--functionfunction–– ISIS--toto--data entitydata entity–– Supporting functionSupporting function--toto--data entitydata entity–– ISIS--toto--business objectivebusiness objective
30
Example Business FunctionExample Business Function--toto--Data Data Entity Matrix (Fig. 2Entity Matrix (Fig. 2--3)3)
31
Two Approaches to Database and Two Approaches to Database and IS DevelopmentIS Development
•• SDLCSDLC–– System Development Life CycleSystem Development Life Cycle–– Detailed, wellDetailed, well--planned development processplanned development process–– TimeTime--consuming, but comprehensiveconsuming, but comprehensive–– Long development cycleLong development cycle
•• PrototypingPrototyping–– Rapid application development (RAD)Rapid application development (RAD)–– Cursory attempt at conceptual data modelingCursory attempt at conceptual data modeling–– Define database during development of initial prototypeDefine database during development of initial prototype–– Repeat implementation and maintenance activities with Repeat implementation and maintenance activities with
new prototype versionsnew prototype versions
32
Systems Development Life CycleSystems Development Life Cycle(see also Figures 2.4, 2.5) (see also Figures 2.4, 2.5)
33
Planning
Analysis
Physical Design
Implementation
Maintenance
Logical Design
Systems Development Life CycleSystems Development Life Cycle(see also Figures 2.4, 2.5) (cont.)(see also Figures 2.4, 2.5) (cont.)
34
Planning
Analysis
Physical Design
Implementation
Maintenance
Logical Design
Planning Purpose––preliminary understandingDeliverable––request for study
Database activity––enterprise modeling and early conceptual data modeling
Systems Development Life CycleSystems Development Life Cycle(see also Figures 2.4, 2.5) (cont.) (see also Figures 2.4, 2.5) (cont.)
35
Planning
Analysis
Physical Design
Implementation
Maintenance
Logical Design
Analysis
Purpose–thorough requirements analysis and structuringDeliverable–functional system specifications
Database activity–thorough and integrated conceptual data modeling
Systems Development Life CycleSystems Development Life Cycle(see also Figures 2.4, 2.5) (cont.) (see also Figures 2.4, 2.5) (cont.)
36
Planning
Analysis
Physical Design
Implementation
Maintenance
Logical DesignLogical Design
Purpose–information requirements elicitation and structureDeliverable–detailed design specifications
Database activity–logical database design (transactions, forms, displays, views, data integrity and security)
Systems Development Life CycleSystems Development Life Cycle(see also Figures 2.4, 2.5) (cont.) (see also Figures 2.4, 2.5) (cont.)
37
Planning
Analysis
Physical Design
Implementation
Maintenance
Logical Design
Physical Design
Purpose–develop technology and organizational specificationsDeliverable–program/data structures, technology purchases, organization redesigns
Database activity–physical database design (define database to DBMS, physical data organization, database processing programs)
Systems Development Life CycleSystems Development Life Cycle(see also Figures 2.4, 2.5) (cont.) (see also Figures 2.4, 2.5) (cont.)
38
Planning
Analysis
Physical Design
Implementation
Maintenance
Logical Design
Implementation
Purpose–programming, testing, training, installation, documentingDeliverable–operational programs, documentation, training materials
Database activity–database implementation, including coded programs, documentation, installation and conversion
Systems Development Life CycleSystems Development Life Cycle(see also Figures 2.4, 2.5) (cont.) (see also Figures 2.4, 2.5) (cont.)
39
Planning
Analysis
Physical Design
Implementation
Maintenance
Logical Design
Maintenance
Purpose–monitor, repair, enhanceDeliverable–periodic audits
Database activity–database maintenance, performance analysis and tuning, error corrections
40
Prototyping Database MethodologyPrototyping Database Methodology(Figure 2.6) (Figure 2.6)
41
Prototyping Database MethodologyPrototyping Database Methodology(Figure 2.6) (Figure 2.6) (cont.)(cont.)
42
Prototyping Database MethodologyPrototyping Database Methodology(Figure 2.6)(Figure 2.6) (cont.)(cont.)
43
Prototyping Database MethodologyPrototyping Database Methodology(Figure 2.6)(Figure 2.6) (cont.)(cont.)
44
Prototyping Database MethodologyPrototyping Database Methodology(Figure 2.6) (Figure 2.6) (cont.)(cont.)
CASECASE•• ComputerComputer--Aided Software Engineering Aided Software Engineering
(CASE)(CASE)––software tools providing automated software tools providing automated support for systems developmentsupport for systems development
•• Three database features:Three database features:–– Data modelingData modeling––drawing entitydrawing entity--relationship relationship
diagramsdiagrams–– Code generationCode generation––SQL code for table creationSQL code for table creation–– RepositoriesRepositories––knowledge base of enterprise knowledge base of enterprise
informationinformation
45
Packaged Data ModelsPackaged Data Models•• Model components that can be purchased, Model components that can be purchased,
customized, and assembled into fullcustomized, and assembled into full--scale data scale data modelsmodels
•• AdvantagesAdvantages–– Reduced development timeReduced development time–– Higher model quality and reliabilityHigher model quality and reliability
•• Two types:Two types:–– Universal data modelsUniversal data models–– IndustryIndustry--specific data modelsspecific data models
46
Managing ProjectsManaging Projects•• ProjectProject––a planned undertaking of related a planned undertaking of related
activities to reach an objective that has a activities to reach an objective that has a beginning and an endbeginning and an end
•• Involves use of review points for:Involves use of review points for:–– Validation of satisfactory progressValidation of satisfactory progress–– Step back from detail to overall viewStep back from detail to overall view–– Renew commitment of stakeholdersRenew commitment of stakeholders
•• Incremental commitmentIncremental commitment––review of systems review of systems development project after each development development project after each development phase with rejustification after each phasephase with rejustification after each phase
47
Managing Projects: People InvolvedManaging Projects: People Involved
•• Business analystsBusiness analysts•• Systems analystsSystems analysts•• Database analysts and data modelersDatabase analysts and data modelers•• UsersUsers•• ProgrammersProgrammers•• Database architectsDatabase architects•• Data administratorsData administrators•• Project managersProject managers•• Other technical expertsOther technical experts
48
Database SchemaDatabase Schema•• External SchemaExternal Schema
–– User ViewsUser Views–– Subsets of Conceptual SchemaSubsets of Conceptual Schema–– Can be determined from businessCan be determined from business--function/data entity function/data entity
matricesmatrices–– DBA determines schema for different usersDBA determines schema for different users
•• Conceptual SchemaConceptual Schema–– EE--R modelsR models––covered in Chapters 3 and 4covered in Chapters 3 and 4
•• Internal Schema Internal Schema –– Logical structuresLogical structures––covered in Chapter 5covered in Chapter 5–– Physical structuresPhysical structures––covered in Chapter 6covered in Chapter 6
49
50
Different people have different views of the database…these are the external schema
The internal schema is the underlying design and implementation
Figure 2-7 Three-schema architecture
51
52
Pine Valley FurniturePine Valley Furniture
53
Segment of project data model (Figure 2-11)
54
Figure 2-12 Four relations (Pine Valley Furniture)
55
Figure 2-12 Four relations (Pine Valley Furniture) (cont.)
56
Functions of a DBMS
Data Storage, Retrieval, and Update.
A User-Accessible Catalog.
Transaction Support.
Concurrency Control Services.
Recovery Services.
Pearson Education © 2009
57
Functions of a DBMS
Authorization Services.
Support for Data Communication.
Integrity Services.
Services to Promote Data Independence.
Utility Services.
Pearson Education © 2009
58
System Catalog
Repository of information (metadata) describing the data in the database.One of the fundamental components of DBMS.Typically stores:– names, types, and sizes of data items;– constraints on the data;– names of authorized users;– data items accessible by a user and the type of
access;– usage statistics.
Pearson Education © 2009
59
Components of a DBMS
Pearson Education © 2009
60
Components of Database Manager (DM)
Pearson Education © 2009
61
Multi-User DBMS Architectures
Teleprocessing
File-server
Client-server
Pearson Education © 2009
62
Teleprocessing
Traditional architecture.Single mainframe with a number of terminals attached.Trend is now towards downsizing.
Pearson Education © 2009
63
File-Server
File-server is connected to several workstations across a network.Database resides on file-server.DBMS and applications run on each workstation.Disadvantages include:– Significant network traffic.– Copy of DBMS on each workstation.– Concurrency, recovery and integrity control more
complex.
Pearson Education © 2009
64
File-Server Architecture
Pearson Education © 2009
65
Traditional Two-Tier Client-Server
Client (tier 1) manages user interface and runs applications.Server (tier 2) holds database and DBMS.Advantages include:– wider access to existing databases;– increased performance;– possible reduction in hardware costs;– reduction in communication costs;– increased consistency.
Pearson Education © 2009
66
Traditional Two-Tier Client-Server
Pearson Education © 2009
67
Traditional Two-Tier Client-Server
Pearson Education © 2009
68
Three-Tier Client-Server
Client side presented two problems preventing true scalability:– ‘Fat’ client, requiring considerable resources on
client’s computer to run effectively.– Significant client side administration overhead.
By 1995, three layers proposed, each potentially running on a different platform.
Pearson Education © 2009
69
Three-Tier Client-Server
Advantages: – ‘Thin’ client, requiring less expensive hardware.– Application maintenance centralized. – Easier to modify or replace one tier without
affecting others. – Separating business logic from database functions
makes it easier to implement load balancing. – Maps quite naturally to Web environment.
Pearson Education © 2009
70
Three-Tier Client-Server
Pearson Education © 2009
71
Transaction Processing Monitors
Program that controls data transfer between clients and servers in order to provide a consistent environment, particularly for Online Transaction Processing (OLTP).
Pearson Education © 2009
72
TPM as middle tier of 3-tier client-server
Pearson Education © 2009