cs377 database systems - emory universitylxiong/cs377_f11/share/slides/02_concepts.pdf ·...
TRANSCRIPT
CS377 Database Systems
Concepts and Architectures
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
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
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?
When to build a database
system?� Large amounts of data to be organized and
processed
� Multiple, typically many, users
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
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
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?
Requirement Analysis
� Data
� Student
� Course
� Section� Section
� Instructors
� Student grades
� Course prerequisites
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
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
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
� 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
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
Requirement analysis
Requirement specification
Conceptual design
conceptual data model
Logical designLogical design
Representational data model
Physical design
Physical data model
Database design implementation
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?
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
Logical Design - Relational Model
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
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
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
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
Three-Schema Architecture
and Data Independence (cont'd.)
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
Database implementation
� Define a new database
� Specify database schema to the DBMS
� Load data
� Manipulate and maintain the database� Manipulate and maintain the database
Conceptual Schemas
Database State
Meta-Data
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
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
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
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
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
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
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