01-data modeling intro_v2

Upload: drshekar

Post on 08-Apr-2018

216 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/7/2019 01-Data Modeling Intro_v2

    1/24

    Data Modeling Overview

    DB 210 Data Modeling

  • 8/7/2019 01-Data Modeling Intro_v2

    2/24

    Modeling

  • 8/7/2019 01-Data Modeling Intro_v2

    3/24

    Discussion Mind Map of Model

    Easy to

    use

    Can

    occupy

    less space

    Can be a

    reasonable

    substitute

    Is a poor

    substitute

    Can be

    thrown

    away

    Less

    expensiv

    e

    Not real

    Professional

    handling not

    required

  • 8/7/2019 01-Data Modeling Intro_v2

    4/24

    Discussion Examples

    Examples of real modelsAircraft model

    Building model

    Fashion models too! Examples of abstract models

    Financial Models

    Data ModelsSimulation Models

  • 8/7/2019 01-Data Modeling Intro_v2

    5/24

    Discussion Why models?

    Real entities are not available Dinosaurs!

    Real entities are expensive tobuild Aircrafts

    Real entities are voluminous Databases

    Real entities do not even exist Financial Models

    There are many reasons why we need models

  • 8/7/2019 01-Data Modeling Intro_v2

    6/24

    Models in Software

    Analysis ModelsExample: Data Flow Diagrams

    Design Models

    Example: Structure Charts, StateDiagrams

    Execution Models

    Call graphs, coverage analysis,performance charts

    Infrastructure Models

    Example: Network diagrams

  • 8/7/2019 01-Data Modeling Intro_v2

    7/24

    Modeling Summary

    Modeling is the process ofabstracting reality

    Modeling is imperative to tackle large

    problems as the real problem may betoo large to comprehend in itsentirety

    Visual Modeling is the processabstracting reality in the form ofpictures

  • 8/7/2019 01-Data Modeling Intro_v2

    8/24

    Data Modeling

  • 8/7/2019 01-Data Modeling Intro_v2

    9/24

    Data Modeling Example

    2574

    John Doe

    A17

    7

    36

    Bangalore

    Chennai

    Software Engineer

    AsiaPac

    janedoe

    He11o!

    2574

    Dane Doe

    423

    A12

    Bangalore

    Chennai

    EMEA jdoe

    we1c0me!

  • 8/7/2019 01-Data Modeling Intro_v2

    10/24

    Data Modeling Example

    2574 John Doe 3536 Cochin A12 Asia jdoe He11o!

    ID Name OfficeAge Home Grade Domain Userid Password

    1364 Dane Doe 2142 Chennai A17 EMEA ddoe We1c0me!

    EMPLOYEE

    This way ofabstracting data using

    meaningful concepts from the domain

    and structuring them using specificnotations is called data modeling.

  • 8/7/2019 01-Data Modeling Intro_v2

    11/24

    Key Data Modeling Concepts

    Data Model

    Abstraction

    Schema

    Database

    Design

    Database

    Mapping

  • 8/7/2019 01-Data Modeling Intro_v2

    12/24

    Key Data Modeling Concepts

    Data Model is acollection of concepts(notations,

    terminology, etc.) thathelp model dataData Model

  • 8/7/2019 01-Data Modeling Intro_v2

    13/24

    Key Data Modeling Concepts

    The key idea behinddata modeling is toavoid dealing withdata directly as muchas possible

    This is achieved bychoosing relevant

    terminology andnotation dependingupon the data model

    Abstraction

  • 8/7/2019 01-Data Modeling Intro_v2

    14/24

    Key Data Modeling Concepts

    Structural descriptionof data created usingthe notations andconcepts defined in aparticular data modelExample: A relational

    schema uses thenotations and concepts

    of the relational datamodel

    Schema

    Note: The terms Schema and Data Model are often used interchangeably as

    in The ER Model for this application is given below

  • 8/7/2019 01-Data Modeling Intro_v2

    15/24

    Key Data Modeling Concepts

    Database design isrealized using aschema

    Schema is only onebut a very significantcomponent ofdatabase design

    DatabaseDesign

  • 8/7/2019 01-Data Modeling Intro_v2

    16/24

    Key Data Modeling Concepts

    Database is therepository that storesdata

    The structure of therepository conformswith a particulardatabase design

    Database

  • 8/7/2019 01-Data Modeling Intro_v2

    17/24

    Key Data Modeling Concepts

    Mapping meanstransforming a schemadefined using one

    model into a schemadefined using anothermodel

    Example: Mapping

    between an ER schemaand a relational schema

    Mapping

  • 8/7/2019 01-Data Modeling Intro_v2

    18/24

    A simplified meta-model

    Data Model Abstraction

    Schema DB Design

    Database

    Mapping

    Defines-rules-for

    creates

    instantiates

    Part-of

    organizes

    provides

  • 8/7/2019 01-Data Modeling Intro_v2

    19/24

    Elements of Data Models - 1

    Define the terminology and semantics forstructuring entities, attributes and relatedmeta-data E.g., Relation, Attribute, Primary Key,

    ForeignKey, etc.

    Define the mechanism for manipulatingthe data using the data model Data Definition Language (DDL)

    Data Manipulation Language (DML)

    Define a set of rules for mapping from onemodel to another (e.g., ER to relational)

  • 8/7/2019 01-Data Modeling Intro_v2

    20/24

    Elements of Data Models - 2

    Enable multiple levels of abstraction(e.g., physical, logical, conceptual)

    Enable compact, efficient and secure

    implementations

    Why not one

    universal

    data model?

  • 8/7/2019 01-Data Modeling Intro_v2

    21/24

    Who is it for, anyway?

    Business user/ Owner

    To get a view of what business datais available without getting boggeddown with large data dumps

    Software

    Designer

    To be able to design applications

    that access the dataSoftwareDeveloper

    To be able to build softwareprograms that help business usersmanipulate the data

    SoftwareMaintenanceEngineer

    To easily understand any issueswith data or underlying softwarewithout getting bogged down withactual data representations

  • 8/7/2019 01-Data Modeling Intro_v2

    22/24

    So what is the big deal?!

    Lets discuss issues with data modeling inthe following domains

    Employee Information

    Organization hierarchy

    Network infrastructure

    Engine design (Aircraft, automobile, etc.)

    Building plan

    Road infrastructure

    Genetics

    Rich media

    Think againWould one size

    fit all?

  • 8/7/2019 01-Data Modeling Intro_v2

    23/24

    A Quick Review of DB Layers

    Physical Schema

    Logical Schema

    External Schema

    Note: We will revisiting this important concept as we go along

  • 8/7/2019 01-Data Modeling Intro_v2

    24/24

    The Big Picture Enterprise Architecture

    Contextual

    Conceptual

    Logical

    Physical

    As Built

    Functioning

    Contextual

    Conceptual

    Logical

    Physical

    As Built

    Functioning

    Why

    Why

    Who

    Who

    When

    When

    Where

    Where

    What

    What

    How

    How

    Contextual

    Conceptual

    Logical

    Physical

    As Built

    Functioning

    Contextual

    Conceptual

    Logical

    Physical

    As Built

    Functioning

    Why

    Why

    Who

    Who

    When

    When

    Where

    Where

    What

    What

    How

    How

    Contextual

    Conceptual

    Logical

    Physical

    As Built

    Functioning

    Contextual

    Conceptual

    Logical

    Physical

    As Built

    Functioning

    Why

    Why

    Who

    Who

    When

    When

    Where

    Where

    What

    What

    How

    How

    Contextual

    Conceptual

    Logical

    Physical

    As Built

    Functioning

    Contextual

    Conceptual

    Logical

    Physical

    As Built

    Functioning

    Why

    Why

    Who

    Who

    When

    When

    Where

    Where

    What

    What

    How

    How

    Source: The Zachman Framework