Chapter 2 Data Models - Cleveland State University

Transcription

11eDatabase SystemsDesign, Implementation, and ManagementChapter 2Data Models 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.

Learning Objectives In this chapter, you will learn: About data modeling and why data models areimportant About the basic data-modeling building blocks What business rules are and how they influencedatabase design 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.2

Learning Objectives In this chapter, you will learn: How the major data models evolved About emerging alternative data models and the needthey fulfill How data models can be classified by their level ofabstraction 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.3

Data Modeling and Data Models Data modeling: Iterative and progressive process ofcreating a specific data model for a determined problemdomain Data models: Simple representations of complexreal-world data structures Useful for supporting a specific problem domain Model - Abstraction of a real-world object or event 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.4

Importance of Data ModelsAre a communication toolGive an overall view of the databaseOrganize data for various usersAre an abstraction for the creation of gooddatabase 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.5

Data Model Basic Building Blocks Entity: Unique and distinct object used to collectand store data Attribute: Characteristic of an entity Relationship: Describes an association amongentities One-to-many (1:M) Many-to-many (M:N or M:M) One-to-one (1:1) Constraint: Set of rules to ensure data integrity 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.6

Business RulesBrief, precise, and unambiguous description of apolicy, procedure, or principleEnable defining the basic building blocksDescribe main and distinguishing characteristicsof the data 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.7

Sources of Business RulesCompanymanagersPolicy interviewswith end users 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.8

Reasons for Identifying and DocumentingBusiness Rules Help standardize company’s view of data Communications tool between users and designers Allow designer to: Understand the nature, role, scope of data, and businessprocesses Develop appropriate relationship participation rules andconstraints Create an accurate data model 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.9

Translating Business Rules into DataModel Components Nouns translate into entities Verbs translate into relationships among entities Relationships are bidirectional Questions to identify the relationship type How many instances of B are related to one instance ofA? How many instances of A are related to one instance ofB? 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.10

Naming Conventions Entity names - Required to: Be descriptive of the objects in the businessenvironment Use terminology that is familiar to the users Attribute name - Required to be descriptive of thedata represented by the attribute Proper naming: Facilitates communication between parties Promotes self-documentation 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.11

Hierarchical and Network ModelsHierarchical Models Manage large amounts of datafor complex manufacturingprojects Represented by an upsidedown tree which containssegments Segments: Equivalent of a filesystem’s record typeNetwork Models Represent complex datarelationships Improve database performanceand impose a databasestandard Depicts both one-to-many(1:M) and many-to-many(M:N) relationships Depicts a set of one-to-many(1:M) relationships 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.12

Hierarchical ModelAdvantages Promotes data sharing Parent/child relationship promotesconceptual simplicity and dataintegrity Database security is provided andenforced by DBMS Efficient with 1:M relationshipsDisadvantages Requires knowledge of physicaldata storage characteristics Navigational system requiresknowledge of hierarchical path Changes in structure requirechanges in all applicationprograms Implementation limitations No data definition Lack of standards 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.13

Network ModelAdvantages Conceptual simplicity Handles more relationship types Data access is flexible Data owner/member relationshippromotes data integrity Conformance to standards Includes data definition language(DDL) and data manipulationlanguage (DML)Disadvantages System complexity limitsefficiency Navigational system yieldscomplex implementation,application development, andmanagement Structural changes requirechanges in all applicationprograms 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.14

Standard Database ConceptsSchema Conceptual organization of the entire database as viewed bythe database administratorSubschema Portion of the database seen by the application programs thatproduce the desired information from the data within thedatabase 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.15

Standard Database ConceptsData manipulation language (DML) Environment in which data can be managed and isused to work with the data in the databaseSchema data definition language (DDL) Enables the database administrator to define theschema components 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.16

The Relational Model Produced an automatic transmission database thatreplaced standard transmission databases Based on a relation Relation or table: Matrix composed of intersectingtuple and attribute Tuple: Rows Attribute: Columns Describes a precise set of data manipulationconstructs 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.17

Relational ModelAdvantages Structural independence ispromoted using independenttables Tabular view improvesconceptual simplicity Ad hoc query capability is basedon SQL Isolates the end user fromphysical-level detailsDisadvantages Requires substantial hardware andsystem software overhead Conceptual simplicity givesuntrained people the tools to use agood system poorly May promote informationproblems Improves implementation andmanagement simplicity 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.18

Relational Database ManagementSystem(RDBMS) Performs basic functions provided by the hierarchicaland network DBMS systems Makes the relational data model easier to understandand implement Hides the complexities of the relational model fromthe user 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.19

Figure 2.2 - A Relational DiagramCengage Learning 2015 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.20

SQL-Based Relational DatabaseApplication End-user interface Allows end user to interact with the data Collection of tables stored in the database Each table is independent from another Rows in different tables are related based on commonvalues in common attributes SQL engine Executes all queries 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.21

The Entity Relationship Model Graphical representation of entities and theirrelationships in a database structure Entity relationship diagram (ERD) Uses graphic representations to model databasecomponents Entity instance or entity occurrence Rows in the relational table Connectivity: Term used to label the relationshiptypes 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.22

Entity Relationship ModelAdvantagesDisadvantages Visual modeling yieldsconceptual simplicity Limited constraintrepresentation Visual representation makes itan effective communicationtool Limited relationshiprepresentation Is integrated with the dominantrelational model No data manipulationlanguage Loss of information contentoccurs when attributes areremoved from entities to avoidcrowded displays 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.23

Figure 2.3 - The ER Model Notations 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.24

The Object-Oriented Data Model (OODM)or Semantic Data Model Object-oriented database managementsystem(OODBMS) Based on OODM Object: Contains data and their relationships withoperations that are performed on it Basic building block for autonomous structures Abstraction of real-world entity Attributes - Describe the properties of an object 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.25

The Object-Oriented Data Model (OODM) Class: Collection of similar objects with sharedstructure and behavior organized in a class hierarchy Class hierarchy: Resembles an upside-down tree inwhich each class has only one parent Inheritance: Object inherits methods and attributesof parent class Unified Modeling Language (UML) Describes sets of diagrams and symbols to graphicallymodel a system 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.26

Object-Oriented ModelAdvantages Semantic content is added Visual representation includessemantic content Inheritance promotes dataintegrityDisadvantages Slow development ofstandards caused vendors tosupply their ownenhancements Compromised widely acceptedstandard Complex navigational system Learning curve is steep High system overhead slowstransactions 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.27

Figure 2.4 - A Comparison of OO, UML,and ER Models 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.28

Object/Relational and XML Extended relational data model (ERDM) Supports OO features and complex datarepresentation Object/Relational Database Management System(O/R DBMS) Based on ERDM, focuses on better data management Extensible Markup Language (XML) Manages unstructured data for efficient andeffective exchange of all data types 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.29

Big Data Aims to: Find new and better ways to manage large amounts ofweb and sensor-generated data Provide high performance and scalability at areasonable cost Characteristics Volume Velocity Variety 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.30

Big Data ChallengesVolume does not allow the usage ofconventional structuresExpensiveOLAP tools proved inconsistent dealingwith unstructured data 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.31

Big Data New TechnologiesHadoopHadoop DistributedFile System (HDFS)MapReduceNoSQL 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated, or posted to a publicly accessible website, in whole or in part.32

NoSQL Databases Not based on the relational model Support distributed database architectures Provide high scalability, high availability, and faulttolerance Support large amounts of sparse data Geared toward performance rather than transactionconsistency Store data in key-value stores 2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or duplicated

29.01.2014 · Data modeling: Iterative and progressive process of creating a specific data model for a determined problem domain Data models: Simple representations of complex real-world data structures Useful for supporting a specific problem domain Model - Abstraction of a real-world object or event 4