40
CS377 Database Systems Concepts and Architectures

CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

  • Upload
    doque

  • View
    219

  • Download
    0

Embed Size (px)

Citation preview

Page 1: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

CS377 Database Systems

Concepts and Architectures

Page 2: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Outline� Definitions and properties of database systems

� How to build a database system

� Requirement analysis

� Database design

� Database implementation� Database implementation

� Data Models

� Three-Schema Architecture

� DBMS components

� Centralized and Client/Server Architectures

for DBMSs

Page 3: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Definitions

� Database

� Collection of related data

� Database management system (DBMS)

� Collection of programs - enables users to � Collection of programs - enables users to

create and maintain a database

� Meta-Data: database definition is stored by

DBMS as database catalog or dictionary

� Database system

� Database and the DBMS software

Page 4: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection
Page 5: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Properties of a Database System

� Scalability – handle large amounts of

information/data

� Concurrency – support multiple users

� Data persistency� Data persistency

� Security – system failures and malicious

users/programs

� Data independence – logical and physical

data independence

� vs. file processing?

Page 6: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

When to build a database

system?� Large amounts of data to be organized and

processed

� Multiple, typically many, users

Page 7: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

When Not to Use a DBMS

� More desirable to use regular files for:

� Simple, small data not expected to change at

all

� Stringent, real-time requirements that may not � Stringent, real-time requirements that may not

be met because of DBMS overhead

� No multiple-user access to data

Page 8: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

How to Build a Database System?

� Requirements specification and analysis

� What information to store

� what functionalities to support

� Database design� Database design

� Conceptual design (Entity-Relationship model)

� Logical design (Relational data model)

� Physical design (data storage, access

structures)

� Implement the database design and

populate data

Page 9: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

A Running Example

� UNIVERSITY database

� Information concerning students, courses, and

grades in a university environment

� Requirement specification and analysis� Requirement specification and analysis

� What data need to be stored? - Records?

Relationship between records?

� What functionalities need to be supported? -

Querying/updating?

Page 10: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Requirement Analysis

� Data

� Student

� Course

� Section� Section

� Instructors

� Student grades

� Course prerequisites

Page 11: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Requirement Analysis

� Examples of queries:

� Retrieve student grades for all the courses he

has taken

� List the names of students who took the � List the names of students who took the

section of the ‘Database’ course offered in Fall

2011 and their grades in that section

� List the prerequisites of the ‘Database’ course

Page 12: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Requirement Analysis

� Examples of updates:

� Change the level of ‘Narjit’ to sophomore

� Create a new section for the ‘Database’ course

for Fall 2011for Fall 2011

� Enter a grade of ‘A’ for ‘Jeremy’ in the

‘Database’ section of Fall 2011

Page 13: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

How to Build a Database System?

� Requirements specification and analysis

� What information to store

� what functionalities to support

� Database design� Database design

� Conceptual design (Entity-Relationship model)

� Logical design (Relational data model)

� Physical design (data storage, access

structures)

� Implement the database design and

populate data

Page 14: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

� Data model

� Collection of concepts that describe the

structure of a database

� Provides means to achieve data abstraction

Data Model

� Provides means to achieve data abstraction

� Data abstraction

� Suppression of details of data organization and

storage

� Highlighting of the essential features for an

improved understanding of data

Page 15: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Categories of Data Models

� High-level or conceptual data models

� Close to the way many users perceive data

� Low-level or physical data models

� Describe the details of how data is stored on � Describe the details of how data is stored on

computer storage media

� Representational data models

� Easily understood by end users

� Also similar to how data organized in computer

storage

Page 16: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Requirement analysis

Requirement specification

Conceptual design

conceptual data model

Logical designLogical design

Representational data model

Physical design

Physical data model

Database design implementation

Page 17: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Conceptual Model: Entity-

Relationship (ER) Model

� Entity

� Represents a real-world object or concept

� Attribute

� Represents some property of interest � Represents some property of interest

� Further describes an entity

� Relationship among two or more entities

� Represents an association among the entities

� University example: entities, relationships?

Page 18: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Representational Data Models

� Relational data model

� Used most frequently in traditional commercial

DBMSs

� Relations or tables� Relations or tables

� Object data model

� New family of higher-level implementation data

models

� Closer to conceptual data models

Page 19: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Logical Design - Relational Model

Page 20: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Physical Data Models

� Describe how data is stored as files in the

computer

� Access path

• Structure that makes the search for particular

database records efficient

� Index

• Example of an access path

• Allows direct access to data using an index term or

a keyword

• E.g. index on student name

Page 21: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

How to Build a Database System?

� Requirements specification and analysis

� What information to store

� what functionalities to support

� Database design� Database design

� Conceptual design (Entity-Relationship model)

� Logical design (Relational data model)

� Physical design (data storage, access

structures)

� Implement the database design and

populate data

Page 22: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Schemas, Instances, and

Database State� Database schema

� Description of a database

� Schema diagram

� Displays selected aspects of schema� Displays selected aspects of schema

� Database state or snapshot

� Data in database at a particular moment in time

� Initial state – populated or loaded with the

initial data

Page 23: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Three-Schema Architecture

and Data Independence� Internal level

� Describes physical storage structure of the

database

� Conceptual level� Conceptual level

� Describes structure of the whole database for a

community of users

� External or view level

� Describes part of the database that a particular

user group is interested in

Page 24: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Three-Schema Architecture

and Data Independence (cont'd.)

Page 25: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Data Independence

� Capacity to change the schema at one level

of a database system

� Without having to change the schema at the

next higher levelnext higher level

� Types:

� Logical independence

� Physical independence

Page 26: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Database implementation

� Define a new database

� Specify database schema to the DBMS

� Load data

� Manipulate and maintain the database� Manipulate and maintain the database

Page 27: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Conceptual Schemas

Page 28: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Database State

Page 29: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Meta-Data

Page 30: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

External View

� View

� Subset of the database, e.g. senior students

� Contains virtual data derived from the

database files but is not explicitly storeddatabase files but is not explicitly stored

Page 31: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

DBMS Languages

� Data definition language (DDL)

• Defines both schemas

� Storage definition language (SDL)

• Specifies the internal schema• Specifies the internal schema

� View definition language (VDL)

• Specifies user views/mappings to conceptual

schema

� Data manipulation language (DML)

• Allows retrieval, insertion, deletion, modification

Page 32: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Outline� Definitions and properties of database systems

� How to build a database system

� Requirement analysis

� Database design

� Database implementation� Database implementation

� Data Models

� Three-Schema Architecture

� DBMS components

� Centralized and Client/Server Architectures

for DBMSs

Page 33: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection
Page 34: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Centralized and Client/Server

Architectures for DBMSs� Centralized DBMSs Architecture

� All DBMS functionality, application program

execution, and user interface processing

carried out on one machinecarried out on one machine

Page 35: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection
Page 36: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Basic Client/Server Architectures� Servers with specific functionalities

� File server

• Maintains the files of the client machines.

� Printer server

• Connected to various printers; all print requests by • Connected to various printers; all print requests by

the clients are forwarded to this machine

� Database server

• Query and transaction functionality related to SQL

processing

� Clients

� Provides user interface capabilities and local

processing

Page 37: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection
Page 38: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Three-Tier and n-Tier

Architectures for Web

Applications� Application server or Web server

� Adds intermediate layer between client and the

database serverdatabase server

� Runs application programs and stores

business rules

� N-tier

� Divide the layers between the user and the

stored data further into finer components

Page 39: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection
Page 40: CS377 Database Systems - Emory Universitylxiong/cs377_f11/share/slides/02_concepts.pdf · Definitions Database Collection of related data Database management system (DBMS) Collection

Outline� Definitions and properties of database systems

� How to build a database system

� Data Models

� Three-Schema Architecture

� DBMS components

� Centralized and Client/Server Architectures

for DBMSs

� Next lecture

� ER modeling