Data Management Design

Slides:



Advertisements
Similar presentations
Relational Database and Data Modeling
Advertisements

Chapter 10: Designing Databases
The Relational Model and Relational Algebra Nothing is so practical as a good theory Kurt Lewin, 1945.
BUSINESS DRIVEN TECHNOLOGY Plug-In T4 Designing Database Applications.
The Relational Database Model
The Relational Model System Development Life Cycle Normalisation
Chapter 3 The Relational Model Transparencies © Pearson Education Limited 1995, 2005.
Systems Development Life Cycle
Database Design Conceptual –identify important entities and relationships –determine attribute domains and candidate keys –draw the E-R diagram Logical.
Chapter 3. 2 Chapter 3 - Objectives Terminology of relational model. Terminology of relational model. How tables are used to represent data. How tables.
The Relational Database Model:
1 © Prentice Hall, 2002 Chapter 5: Logical Database Design and the Relational Model Modern Database Management 6 th Edition Jeffrey A. Hoffer, Mary B.
Introduction to Databases Transparencies
Chapter 11 Data Management Layer Design
1 Minggu 2, Pertemuan 3 The Relational Model Matakuliah: T0206-Sistem Basisdata Tahun: 2005 Versi: 1.0/0.0.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
Data at the Core of the Enterprise. Objectives  Define of database systems  Introduce data modeling and SQL  Discuss emerging requirements of database.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
Database Management COP4540, SCS, FIU An Introduction to database system.
Michael F. Price College of Business Chapter 6: Logical database design and the relational model.
Chapter 14 & 15 Conceptual & Logical Database Design Methodology
IST Databases and DBMSs Todd S. Bacastow January 2005.
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
Chapter 4 The Relational Model Pearson Education © 2014.
Chapter 4 The Relational Model.
Copyright © 2012 Pearson Education, Inc. Publishing as Prentice Hall 9.1.
Chapter 3 The Relational Model Transparencies Last Updated: Pebruari 2011 By M. Arief
Data at the Core of the Enterprise. Objectives  Define of database systems.  Introduce data modeling and SQL.  Discuss emerging requirements of database.
2Object-Oriented Analysis and Design with the Unified Process Objectives  Describe the differences and similarities between relational and object-oriented.
DBMS Lecture 9  Object Database Management Group –12 Rules for an OODBMS –Components of the ODMG standard  OODBMS Object Model Schema  OO Data Model.
Web-Enabled Decision Support Systems
RAJIKA TANDON DATABASES CSE 781 – Database Management Systems Instructor: Dr. A. Goel.
MIS 385/MBA 664 Systems Implementation with DBMS/ Database Management Dave Salisbury ( )
Database Technical Session By: Prof. Adarsh Patel.
1 Introduction to Database Systems. 2 Database and Database System / A database is a shared collection of logically related data designed to meet the.
Concepts and Terminology Introduction to Database.
Databases and Statistical Databases Session 4 Mark Viney Australian Bureau of Statistics 5 June 2007.
Data Management Design G.Ramesh Babu. In This Lecture You Will Learn: n The different ways of storing persistent objects n The differences between object.
Copyright 2008 McGraw-Hill Ryerson 1 TECHNOLOGY PLUG-IN T5 DESIGNING DATABASE APPLICATIONS.
1 The Relational Database Model. 2 Learning Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical.
CSCI 3140 Module 3 – Logical Database Design for the Relational Model Theodore Chiasson Dalhousie University.
Lecture2: Database Environment Prepared by L. Nouf Almujally & Aisha AlArfaj 1 Ref. Chapter2 College of Computer and Information Sciences - Information.
Object Persistence Design Chapter 13. Key Definitions Object persistence involves the selection of a storage format and optimization for performance.
9/7/2012ISC329 Isabelle Bichindaritz1 The Relational Database Model.
Chapter 12: Designing Databases
Lecture2: Database Environment Prepared by L. Nouf Almujally 1 Ref. Chapter2 Lecture2.
Relational Database. Database Management System (DBMS)
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.
Databases Shortfalls of file management systems Structure of a database Database administration Database Management system Hierarchical Databases Network.
MANAGING DATA RESOURCES ~ pertemuan 7 ~ Oleh: Ir. Abdul Hayat, MTI.
Programming Logic and Design Fourth Edition, Comprehensive Chapter 16 Using Relational Databases.
Chapter 2 Relational Database Design and Normalization August
Lection №4 Development of the Relational Databases.
CSE323 การวิเคราะห์และออกแบบระบบ (Systems Analysis and Design) Lecture 12: Data Management Design.
The Relational Model. 2 Relational Model Terminology u A relation is a table with columns and rows. –Only applies to logical structure of the database,
Logical Database Design and the Relational Model.
Chapter 3: Relational Databases
The Relational Model © Pearson Education Limited 1995, 2005 Bayu Adhi Tama, M.T.I.
Lecture 4: Logical Database Design and the Relational Model 1.
1 10 Systems Analysis and Design in a Changing World, 2 nd Edition, Satzinger, Jackson, & Burd Chapter 10 Designing Databases.
Week 2 Lecture The Relational Database Model Samuel ConnSamuel Conn, Faculty Suggestions for using the Lecture Slides.
Chapter 4 The Relational Model Pearson Education © 2009.
Database Planning Database Design Normalization.
September 2000C.Watters1 Data & Database Management Systems (DBMS) ECMM6010.
IT 5433 LM3 Relational Data Model. Learning Objectives: List the 5 properties of relations List the properties of a candidate key, primary key and foreign.
Databases and DBMSs Todd S. Bacastow January
Chapter 4 Logical Database Design and the Relational Model
An Introduction to database system
Chapter 4 Relational Databases
Presentation transcript:

Data Management Design DBMS and Designing for RDBMS

Persistence Persistent data is data that must be stored in a data storage system it is data that must be stored after the program that creates or amends it has stopped running it should usually be available to other users Transient data is data that is created or used while the system is running but is not required after the system stops running

Storage of Persistent Data or Objects Persistent data or objects may be stored in – files for storing data which is transferred to or from other systems configuration information – database management systems (DBMS) relational DBMS – hold tables of data object DBMS – hold objects and links the choice of DBMS will have an impact on the amount of work required of the system designers

Database Management Systems (DBMS) In order to resolve data storage problems analyse the storage requirements of all applications use a database management system to organise and manage the data required by the different applications The Three-schema architecture External Schema The view on data used by application programs Conceptual Schema The logical model of data that is separated from How it is used Internal Schema The physical storage of data in files and indexes

DBMS Features (1) Data definition Language (DDL) used to specify the data held in a DBMS and the structures that are used to hold it Data manipulation language (DML) used to specify updates and retrievals of data Integrity constraints Transaction management if any of the component updates in a transaction do not succeed, the transaction is rolled back

DBMS Features (2) Concurrency Security Tuning of storage many users may use the database simultaneously Security access to the database can be controlled Tuning of storage tools can be used to monitor the way that data is accessed and to improve the structures to make access more efficient

Advantages and Disadvantages of DBMS + Eliminates unnecessary duplication of data + Enforces data integrity through the use of constraints and transaction management techniques + Changes to the conceptual schema should not affect the application programs and changes to the internal schema should have no impact on the conceptual schema + Tools are available for tuning the performance of the database – DBMS packages are costly – Running costs involve paying staff to manage the DBMS – Processing overhead in converting data from the database to the format required by application programs

Integrating Application and Database Modelling

Types of DBMS – RDBMS (1) Relational database management systems (RDBMS) eliminate redundancy (or duplication) from data represent data in two-dimensional tables (or relations) consist of rows of data organised in columns each column contains data values of the same attribute type the data in each row must be distinct each attribute value must be atomic all data structures must be decomposed into two-dimensional tables

Types of DBMS – RDBMS (2)

Types of DBMS – RDBMS (3) Referential integrity constraints are used to model and maintainnrelationships between tables by comparing primary key values in one table with foreign key values in another a foreign key is a set of columns whose values are either NULL or match the values of the primary key in another (or same) table

Weaknesses of relational databases objects in OO systems do not fit easily into this model objects must be broken down into tables this incurs a processing overhead references to other objects must be maintained/restored RDBMS are widely used Access, Oracle, SQL Server, Informix, Ingres, MySQL

Types of DBMS (5) Object database management systems (ODBMS) have been developed to handle complex, nested objects multimedia applications computer-aided design packages Object-relational databases combine the efficiency of relational databases with the ability of object databases to store complex objects

Designing for Relational Database Management Systems If an RDBMS is used to provide storage for an OO system, it is necessary to flatten the classes into tables complex objects must be taken apart and the parts stored in different tables when the system requires an object, the data must be retrieved from the tables which hold parts of that object so that it can be reconstructed Two approaches can be used to convert classes to tables normalisation a series of rules of thumb

Normalisation Normalisation is based on the idea of functional dependency for two attributes A and B, A is functionally dependent on B if for every value of B there is exactly one value of A associated with it at any given time: B →A There are five normal forms of normalised data the data is free of redundancy in fifth normal form for practical purposes it is usually adequate to normalise data into third normal

Example: InternationalCampaign Objects

Table for InternationalCampaign Objects Convert to first normal form (1NF) a table is in first normal form (1NF) if and only if all row/column intersections contain atomic values Multiple values are known as repeating groups

1NF Table for InternationalCampaign Objects

Second Normal Form (2NF) A candidate primary key in the previous table may be formed from the attributes campaignCode and locationCode Convert the data in the previous table into second normal form (2NF) a table/relation is in 2NF if and only if it is in 1NF and every nonkey attribute is fully dependent on the primary key part-key dependencies campaignTitle is dependent on campaignCode locationName is dependent on locationCode

2NF Table for InternationalCampaign Objects

Third Normal Form (3NF) A relation is in third normal form (3NF) if and only if it is in 2NF and every attribute is dependent on the primary key and not on any other non-key attribute in InternationalCampaign-2, locationMgrTel is dependent on locationMgr and not on the primary key (campaignCode and locationCode)

3NF Table for InternationalCampaign Objects

Entity-Relationship Diagram

Class Diagram for InternationalCampaign

Rules for Mapping Classes to Tables (1) The second approach involves using a series of rules of thumb to map classes and their relationships to tables in a RDBMS Mapping entity classes classes with a simple data structure become tables and their object identifiers become primary keys Mapping associations one-to-one or one-to-many associations are implemented by inserting a foreign key in one table to match the primary key of the other table many-to-many associations are implemented using two separate tables for each object, as well as an intersection table each row in the intersection table contains a pair of object identifiers, one from each object involved in the association

Mapping Entity Classes to Relational Tables

Mapping Associations (1)

Mapping Associations (2)

Rules for Mapping Classes to Tables (2) Mapping aggregations one-to-one composition combine the subset and superset entity classes in a single table one-to-one aggregation and one-to-many aggregation (and composition) create two separate tables – one for the subset class and one for the superset class the subset table should contain a foreign key which is equal to the primary

Mapping Aggregations (1)

Mapping Aggregations (2)

Rules for Mapping Classes to Tables (3) There are three ways to map a generalisation hierarchy to relational database tables implement all classes as separate tables to retrieve data for a subclass both its own table and its superclass table must be accessed implement the superclass as a table attributes of subclasses become attributes of the superclass table implement the concrete subclasses as tables attributes of the superclass are held in the subclass tables this only works if the superclass is abstract

Mapping Generalisations (1)

Implement all Classes as Separate Tables

Implement the Superclass as a Table

Implement each Concrete Subclass as a Table

Object Database Management Systems (1) Object DBMS can store complex objects directly The standard for object databases has been set by the Object Data Management Group (ODMG) defines ODL (Object Definition Language) and OML (Object Manipulation Language) not all ODBMS conform to the standard Object DBMS are closely linked to the programming languages with ways of navigating through the database

Object Database Management Systems (2) Object databases transparently materialise objects from the database into memory Only minimal changes to the structure of the class diagram are required ODBMS do not support the storage of operations in the database except simple operations like inserting values or simple arithmetic