Chapter 2 Database Planning and Database Architecture

Slides:



Advertisements
Similar presentations
Data Modeling and Database Design Chapter 1: Database Systems: Architecture and Components.
Advertisements

Database Systems: Design, Implementation, and Management Tenth Edition
Database Systems: Design, Implementation, and Management Ninth Edition
Introduction to Databases
Introduction to Database Management  Department of Computer Science Northern Illinois University January 2001.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
1 Chapter 2 Database Environment Transparencies © Pearson Education Limited 1995, 2005.
Chapter 2 Database Environment.
File Systems and Databases
Chapter 2 Database Environment. Agenda Three-Level ANSI-SPARC Architecture Database Languages Data Models Functions of DBMS Components of DBMS Teleprocessing.
Introduction to Databases Transparencies
Chapter 2 Database Environment Pearson Education © 2014.
1 Chapter 2 Database Environment. 2 Objectives of Three-Level Architecture u All users should be able to access same data u User’s view immune to changes.
Mgt 20600: IT Management & Applications Databases Tuesday April 4, 2006.
Lecture Two Database Environment Based on Chapter Two of this book:
1 Chapter 2 Database Environment. 2 Chapter 2 - Objectives u Purpose of three-level database architecture. u Contents of external, conceptual, and internal.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Chapter One Overview of Database Objectives: -Introduction -DBMS architecture -Definitions -Data models -DB lifecycle.
LECTURE 2 DATABASE SYSTEM CONCEPTS AND ARCHITECTURE.
Introduction to DBMS Purpose of Database Systems View of Data
Database Environment 1.  Purpose of three-level database architecture.  Contents of external, conceptual, and internal levels.  Purpose of external/conceptual.
Database System Concepts and Architecture Lecture # 3 22 June 2012 National University of Computer and Emerging Sciences.
Database System Development Lifecycle © Pearson Education Limited 1995, 2005.
Information storage: Introduction of database 10/7/2004 Xiangming Mu.
CS370 Spring 2007 CS 370 Database Systems Lecture 2 Overview of Database Systems.
Announcements Homework 1 Due 9/15 Project: Step 1 Due 9/17 Reading for Wednesday –2.6 – 2.8.
Chapter 2 CIS Sungchul Hong
Chapter 2 Database Environment
CSC271 Database Systems Lecture # 4.
2 1 Chapter 2 Data Models Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database System Concepts and Architecture
Database Systems: Design, Implementation, and Management Ninth Edition
2. Database System Concepts and Architecture
Architecture for a Database System
Chapter 1 : Introduction §Purpose of Database Systems §View of Data §Data Models §Data Definition Language §Data Manipulation Language §Transaction Management.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
©Silberschatz, Korth and Sudarshan1.1Database System Concepts Chapter 1: Introduction Purpose of Database Systems View of Data Data Models Data Definition.
Chapter 2 Database Environment. Agenda Three-Level ANSI-SPARC Architecture Database Languages Data Models Functions of DBMS Components of DBMS Data Dictionary.
Ihr Logo Fundamentals of Database Systems Fourth Edition El Masri & Navathe Chapter 2 Database System Concepts and Architecture.
1 Chapter 1 Introduction. 2 Introduction n Definition A database management system (DBMS) is a general-purpose software system that facilitates the process.
Lecture # 3 & 4 Chapter # 2 Database System Concepts and Architecture Muhammad Emran Database Systems 1.
DataBase Management System What is DBMS Purpose of DBMS Data Abstraction Data Definition Language Data Manipulation Language Data Models Data Keys Relationships.
Lesson Overview 3.1 Components of the DBMS 3.1 Components of the DBMS 3.2 Components of The Database Application 3.2 Components of The Database Application.
1 CS 430 Database Theory Winter 2005 Lecture 2: General Concepts.
Database Environment Chapter 2. Data Independence Sometimes the way data are physically organized depends on the requirements of the application. Result:
Bayu Adhi Tama, M.T.I 1 © Pearson Education Limited 1995, 2005.
1Mr.Mohammed Abu Roqyah. Database System Concepts and Architecture 2Mr.Mohammed Abu Roqyah.
Database Environment Session 2 Course Name: Database System Year : 2013.
1 Chapter 1 Introduction to Databases Transparencies.
Chapter 2 Database Environment.
1 Chapter 2 Database Environment Pearson Education © 2009.
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
Database Environment Chapter 2. The Three-Level ANSI-SPARC Architecture External Level Conceptual Level Internal Level Physical Data.
Databases Salihu Ibrahim Dasuki (PhD) CSC102 INTRODUCTION TO COMPUTER SCIENCE.
LECTURE TWO Introduction to Databases: Data models Relational database concepts Introduction to DDL & DML.
Data Models. 2 The Importance of Data Models Data models –Relatively simple representations, usually graphical, of complex real-world data structures.
©Silberschatz, Korth and Sudarshan 1.1 Database System Concepts قواعد البيانات Data Base قواعد البيانات CCS 402 Mr. Nedal hayajneh E- mail
CS 325 Spring ‘09 Chapter 1 Goals:
Introduction to DBMS Purpose of Database Systems View of Data
Databases and DBMSs Todd S. Bacastow January 2005.
Chapter 2 Database Environment.
Chapter 2 Database Environment.
Chapter 2 Database Environment Pearson Education © 2009.
Chapter 2 Database Environment.
Data Model.
UNIT-I Introduction to Database Management Systems
Chapter 2 Database Environment Pearson Education © 2009.
Chapter 2 Database Environment Pearson Education © 2009.
Presentation transcript:

Chapter 2 Database Planning and Database Architecture

Data as a Resource Resource: an asset that has value and incurs cost Resources include capital equipment, financial assets, personnel and data Database is a resource because Operational data has value Database incurs cost Professionally managed by DBA

Three Levels of Data Real world Conceptual or Logical level of data Enterprise in its environment Mini-world, or Universe of Discourse – part of the world that is represented in the database Conceptual or Logical level of data Entities, entity sets, attributes, relationships Metadata, data about data Structure, record types, data item types, data constraints, data aggregates Stored in data dictionary Data occurrences / Existence of data Database itself Data instances files

Three Levels of Discussing Data Realm Objects Examples Real World Containing Miniworld Enterprise Some aspects of the enterprise Corporation, university, bank Human resources Student enrollment Customers and accounts Conceptual Model or Logical Model Metadata: data definitions, stored in Data Dictionary also known as Catalog Entitty Attribute Entity set Relationship Record type Data item type Data Aggregator A student, a class Name, schedule All students, all classes Student entity relates to class entity by being enrolled in it Student record type, Class record type stuid, classNumber Address, consisting of street, name, state, ZIP Data Occurrences stored in the database Student record occurrence Data item occurrence File Database Record of student Tom Smith ‘S1001’, ‘Smith’, ‘Tom’,’History’,90 Student file with 5000 Student records University database containing Student file, Class file, Faculty file, …

Database Design Systems analysis approach to design assumes every system has a lifecycle, and will eventually be replaced Staged database design centers on first developing a conceptual model that evolves and survives

Characteristics of a Conceptual Database Model Faithfully mirrors the operations of the organization Flexible enough to allow changes as new information needs arise Supports many different user views Independent of physical implementation Does not depend on the model used by a particular database management system

Stages in Database Design Analyze User Environment Develop Conceptual Model Choose DBMS Develop Logical Model Develop Physical Model Evaluate Physical Model Tune System Implement System Analyze user environment Develop conceptual data model Choose a DBMS Develop logical model, by mapping conceptual model to DBMS Develop physical model Evaluate physical model Perform tuning, if indicated Implement physical model See Figure 2.3 – note loops Figure 2.3 Steps in Staged Database Design

Design Tools CASE (Computer-Aided Software Engineering) tools Upper case: used for collecting and designing data, designing logical model, designing applications Lower case: used for implementing the database, including prototyping, data conversion, generating application code, generating reports, testing Data dictionary Data flow diagram

Data Dictionary Contains metadata Can be integrated (part of DBMS) or free-standing Useful for Collecting information about data in central location Securing agreement on meanings of items Communicating with users Identifying inconsistencies – synonyms and homonyms Keeping track of changes to DB structure Determining impact of changes to DB structure Identifying sources of/responsibility for items Recording external/logical/physical models & mappings Recording access control information Providing audit information

Three-level Database Architecture CODASYL DBTG and ANSI reports proposed viewing database architecture at 3 levels of abstraction – external, logical, internal - each with a written description called a schema Rationale for separation of external and internal levels Different users need different views of same data Users data needs may change over time Hides complexity of database storage structures Can change logical structure without affecting all users Database structure unaffected by changes to the physical aspects of storage See figure in book CODASYL : Conference on Data Systems and languages DBTG: Database Task Group ANSI: American National Standard Institute

External Level Consists of many user models or views Has external records - records seen by users May include calculated or virtual data Described in external schemas (sub-schemas) Used to create user interface

Logical Level Entire information structure of database “community view” as seen by DBA Collection of logical records All entities, attributes, relationships represented Includes all record types, data item types, relationships, constraints, semantic information, security and integrity information Relatively constant over time Described in logical schema Used to create logical record interface

Internal Level The DBMS and Operating System View Physical implementation level Includes data structures, file organizations used by DBMS Depends on what DBMS is used Described in internal schema Used to create stored record interface with operating system Operating system creates physical files and physical record interface

Data Independence Logical data independence Physical data independence The capacity to change the logical model without having to change the external view or application programs. Immunity of external models to changes in the logical model Occurs at user interface level Physical data independence Immunity of logical model to changes in internal model Occurs at logical interface level

Data Sublanguages Every DBMS uses a data sublanguage to describe and maintain the database, which has two parts Data definition language (DDL) - used to define the database Used by the DBA and database designers to specify the conceptual schema of a database. In many DBMSs, the DDL is also used to define internal and external schemas (views). Data manipulation language (DML) - is used to process the database Data sublanguage may be embedded in a general programming language (such as Java, C, C++, C#, COBOL, and so on) which is called the host language

Planning and Design Stage Preliminary planning Identifying user requirements Developing and maintaining the data dictionary Designing the conceptual model Choosing a DBMS Developing the logical model Developing the physical model

Development Phase Creating and loading the database Developing user views Writing and maintaining documentation Developing and enforcing data standards Developing and enforcing application program standards Developing operating procedures Doing user training

Database Management Phase Monitoring performance Tuning and reorganizing Keeping current on database improvements

Data Models Collection of tools for describing structure of database Often includes a type of diagram and specialized vocabulary Description of the data, relationships in data, constraints on data, some data meanings Most permanent part in database architecture corresponds to conceptual level or logical level Intension or scheme of the database

Data Models (Cont…) Data Models can be divided into three major types Semantic Data Models A semantic model, captures only meanings Example: Entity Relationship Model (E-R Model) Record Based Models They allow the designer to develop and specify the logical structure and provide some options for implementation of the design Examples Hierarchical Model Network Model Relational Model Object Based Models Object Oriented Model Object / Relational Model (Also known as Extended Relational Model will be seen in some later lectures)

Entity-Relationship Model Conceptual level model Proposed by Peter Chen in 1970s Entities are real-world objects about which we collect data Attributes describe the entities Relationships are associations among entities Entity set – set of entities of the same type Relationship set – set of relationships of same type Relationships sets may have descriptive attributes Represented by E-R diagrams

Entity-Relationship Model (Cont…) Symbol Name Meaning Example Rectangle Entity Student Ellipse Attribute STDNAME ENROLL Diamond Relationship Student Line Link STDNAME

Entity-Relationship Model (Cont…) STDNAME CourseNO STDID CTITLE Student ENROLL ROOM Course MAJOR CREDITS PROF SCHEDUAL Grade

Relational Model Record-based model Logical-level model Proposed by E.F. Codd Based on mathematical relations Uses relations, represented as tables Columns of tables represent attributes Tables represent relationships as well as entities Successor to earlier record-based models—network and hierarchical

Relational Model - Example Student - Table Enrollment - Table STDID STDNAME MAJOR CREDITS S1001 Ali Ahmad Computer Science 60 S1002 Kamal Khan Math 40 S1003 Shoaib Mansoor C_ID STDID Grade Csc01A S1001 B+ Csc01B A Mth01A S1002 B Class - Table C_ID CNAME PROF SCHED ROOM Mth01A Calculus I Mutiullah MW9 R25 Csc01A Intro to Algo Talha TuF10 N45 Csc01B Programming I Imran TuThF9 N40

Hierarchical Model Hierarchical Database model is one of the oldest database models. This model is like a structure of a tree with the records forming the nodes and fields forming the branches of the tree. The hierarchical structure contains levels, or segments. A segment is the equivalent of a file system’s record type. Within the hierarchy, a higher layer is perceived as the parent of the segment directly beneath it, which is called the child. The hierarchical model depicts a set of one-to- many (1:M) relationships between a parent and its children segments.

Hierarchical Model - Example Class C_ID CNAME PROF SCHED ROOM Student STDID STDNAME MAJOR CREDITS

Hierarchical Model - Example Csc01A Intro to Algo Talha TuF10 N45 S1001 Ali Ahmad Computer Science 60 S1008 Noman Ch Computer Science 60 S1002 Kamal Khan Computer Science 60

Network Model The Network model replaces the hierarchical tree with a graph thus allowing more general connections among the nodes. The main difference of the network model from the hierarchical model, is its ability to handle many to many (N:N) relations. In other words, it allows a record to have more than one parent. Suppose an employee works for two departments, or a student taking two classes. The strict hierarchical arrangement is not possible here and the tree becomes a more generalized graph – a network. The network model was evolved to specifically handle non-hierarchical relationships. A network structure thus allows 1:1 (one:one), 1:M (one:many), M:M (many:many) relationships among entities. In network database terminology, a relationship is a set. Each set is made up of at least two types of records: an owner record (equivalent to parent in the hierarchical model) and a member record (similar to the child record in the hierarchical model).

Network Model - Example Mth01A Calculus I Mutiullah MW9 R25 Csc01A Intro to Algo Talha TuF10 N45 S1001 Ali Ahmad Computer Science 60 S1008 Noman Ch Computer Science 60 S1002 Kamal Khan Computer Science 60

Object-oriented Model Similar to E-R but includes encapsulation, inheritance Objects have both state and behavior State is defined by attributes Behavior is defined by methods (functions or procedures) Designer defines classes with attributes, methods, and relationships Class constructor method creates object instances Each object has a unique object ID Classes related by class hierarchies Both conceptual-level and logical-level model

Database Administrator Skills DBA must be Technically competent Good manager Have excellent interpersonal and communication skills Has primary responsibility for planning, designing, developing and managing the operating database Database designer may do conceptual and logical design; DBA does physical design, implementation and manages system