System Concepts and Architecture Rose-Hulman Institute of - - PowerPoint PPT Presentation

system concepts and architecture
SMART_READER_LITE
LIVE PREVIEW

System Concepts and Architecture Rose-Hulman Institute of - - PowerPoint PPT Presentation

System Concepts and Architecture Rose-Hulman Institute of Technology Curt Clifton Data Model A set of concepts to describe Database structure Basic operations on the data Categories of Data Models Conceptual Closest to


slide-1
SLIDE 1

System Concepts and Architecture

Rose-Hulman Institute of Technology Curt Clifton

slide-2
SLIDE 2

Data Model

 A set of concepts to describe

 Database structure  Basic operations on the data

slide-3
SLIDE 3

Categories of Data Models

 Conceptual

 Closest to users’ views

 Implementation

 Intermediate level for programmers

 Physical

 Actual hardware level

slide-4
SLIDE 4

Database Schema

 A description of the database  Not the actual data in it  Tends to change seldom  Shown with a Schema Diagram

slide-5
SLIDE 5

Database State

 Actual content at an instant in time  Every change results in a new state  DBMS tries to ensure only valid states occur

slide-6
SLIDE 6

Three-Schema Architecture

 Goals:

 Support program-data independence  Represent multiple views of data

slide-7
SLIDE 7

The Three Schemas

 Internal schema

 Describes storage with physical data model

 Conceptual schema

 Describes entire database structure

with conceptual or implementation data model

 External schemas

 Describe user views

typically with same data model

slide-8
SLIDE 8

Data Independence

 Two kinds:

 Logical: change conceptual schema without

changing external schemas

 Physical: change internal schema without

changing conceptual

 Just update mappings

slide-9
SLIDE 9

Database System Architectures

 Centralized

 All processing on one machine  Mainframe + dumb terminals

 Client-Server

 Specialized server machines for each function  Smart client machines provide interfaces  Connected via some sort of network

slide-10
SLIDE 10

Two Tier Client-Server

 Client runs UI and application programs  Uses API to connect directly to DBMS  Perhaps multiple DBMS

slide-11
SLIDE 11

Three Tier Client-Server

 Intermediate layer

 Application Server or Web Server

 Advantages

 Security  Scalability

 Disadvantage

 Complexity

slide-12
SLIDE 12

Entity-Relationship Model

Rose-Hulman Institute of Technology Curt Clifton

slide-13
SLIDE 13

Entity-Relationship Model

 Lets us sketch database designs

 Sketches called ER Diagrams  Simple enough share with customers

 Can convert sketches into implementations

 Conversion is easy (with practice)

slide-14
SLIDE 14

Entity Sets

 Entity: a “thing” that database tracks  Entity set: a collection of similar entities  Attribute: property of an entity

 Simple values, like integers or strings  All entities in set have same properties

(though different values)

slide-15
SLIDE 15

Entity Set Notation

Entity Set Name Attribute 1 Attribute 2 Attribute 3 Entity set names are usually singular, i.e. “Employee” not “Employees”

slide-16
SLIDE 16

Relationships

 Connect two (or more) entity sets  Notation:

 Try to make verbs read left-to-right, top-to-

bottom

Entity Set 1 Entity Set 2 Verbs

slide-17
SLIDE 17

Values

 Entity set value:

 The set of entities in it

 Relationship value:

 A set of pairs (or triples, …) with

  • ne element from each related entity set
slide-18
SLIDE 18

Multi-way Relationships

 Connect more than two entity sets  Useful for more complex relationships

slide-19
SLIDE 19

Relationship Constraints

 One-One:

 Entity of first set can connect to just one entity in

second set, and vice versa

Entity Set 1 Entity Set 2 Verbs

1 1

slide-20
SLIDE 20

Relationship Constraints

 One-Many:

 Entity of first set can connect to just one entity in

second set

 Entity of second set can connect to many in first  Use N for arbitrary number greater than 1,

  • r put specific number

Entity Set 1 Entity Set 2 Verbs

N 1

slide-21
SLIDE 21

Relationship Constraints

 Many-Many:

 An entity of either set can connect to many

entities in the other set

 Use N and M for arbitrary number greater than 1,

  • r put specific number (or omit)

Entity Set 1 Entity Set 2 Verbs

N M

slide-22
SLIDE 22

Relationship Constraints

 Numbers on lines indicate maximums  Can also show that every entity must

participate

 Every entity of first set must be related to at least

  • ne entity of the second set

Entity Set 1 Entity Set 2 Verbs

M N

slide-23
SLIDE 23

Attributes on Relationships

 Sometimes attribute is property of relationship

instead of either entity

Entity Set 1 Entity Set 2 Verbs Attribute

slide-24
SLIDE 24

Recursive Relationships

 When an entity set is

related to itself

 Label edges with roles  Consider “Cousin Of”

Symmetrical

No clear role names Person Marries

wife husband

slide-25
SLIDE 25

Subclasses

 Subclass = fewer entities

 Have more properties

 Entity of subclass set is also

in superclass set

 Has all attributes of both sets

Superclass Entity Set Subclass Entity Set

isa

slide-26
SLIDE 26

Keys

 Let us tell entities apart  The key for an entity set is a subset of the

attributes for that entity set, such that no two entities agree on all the attributes

slide-27
SLIDE 27

Showing Keys

 Each entity must have a key  Shown by underlining names of key attributes  For subclass hierarchies:

 Only the root entity set has a key  All entities in hierarchy use that key

slide-28
SLIDE 28

Weak Entity Sets

 When even all the attributes aren’t enough for

a key…

 Use a many-one relationship to “borrow” an

additional attribute for the key

slide-29
SLIDE 29

Example Weak Entity Set

 Consider football players in a fantasy league

 Is Name a key?  Is Number a key?

 Need Number + Team Played On

Player Team Plays

  • n

name name number

1

slide-30
SLIDE 30

Practice with E-R Diagrams

 In groups of 2–3 work on HW Problem 3.21

 On back of handout