Top Banner
Welcome to chapter 2 Chapter 2 Database Archetecture
40
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Welcome to chapter 2 Chapter 2 Database Archetecture.

Welcome to chapter 2

Chapter 2 DatabaseArchetecture

Page 2: Welcome to chapter 2 Chapter 2 Database Archetecture.

Chapter 2

Archetecture

Page 3: Welcome to chapter 2 Chapter 2 Database Archetecture.

The content 1).Database Users

2).Benifits of Database

3).History of database

4).Data Model, Schema

5). Three-Schema Architecture

6). Database Architecture

Difficulty: Three-Schema Architecture

Focus on: Three-Schema Architecture

Hours:2 hours

Teaching way: ppt

Page 4: Welcome to chapter 2 Chapter 2 Database Archetecture.

Database Users

Database Designers: They are responsible to define the content, the

structure, the constraints, and functions or transactions in the database. They must communicate with the end-users and understand their needs.

End-users: They use the data for queries, reports and some of them

actually update the database content.

Page 5: Welcome to chapter 2 Chapter 2 Database Archetecture.

Database Administrator Coordinates all the activities of the database

system has a good understanding of the enterprise’s information

resources and needs. Database administrator's duties include:

Storage structure and access method definition Define the structure of the database Granting users authority to access the database Backing up data Monitoring performance and responding to changes

Page 6: Welcome to chapter 2 Chapter 2 Database Archetecture.

Design a Database

DATABASEADMINISTRATOR

Startup and Shut Down the database

Create Primary Storage Structures

Backup and Recovery

Understand the Oracle Architecture

Enroll and Monitor Users

Grant and Revoke Privileges

Manage Database Storage

Database Administrator Duties

DBA Responsibilities• Install and upgrade ORACLE

server and applications• Create primary database storage

and primary objects• Allocate system storage and plan

future storage needs• Modify the database structures• Enroll and monitor user access to

the database• Back up and recover the database• Maintain system Security• Monitor and optimize

performance

Page 7: Welcome to chapter 2 Chapter 2 Database Archetecture.

Benefits of Database Technology

- Controlling redundancy in data storage and in development and maintenance efforts.

- Sharing of data among multiple users.- Restricting unauthorized access to data.- Providing multiple interfaces to

different classes of users.- Representing complex relationships

among data.- Enforcing integrity constraints on the

database.- Providing backup and recovery services.- Potential for enforcing standards.- Flexibility to change data structures.- Reduced application development time.- Availability of up-to-date information.

Economies of scale.

Timetable

StudentAdmin

Scheduler

Payroll

Year List

Cheques

Students Course Data Lecturer Data

Timetable

StudentAdmin

Scheduler

Payroll

Year List

Cheques

Students Course Data Lecturer Data

DataBase Management System

Database

Page 8: Welcome to chapter 2 Chapter 2 Database Archetecture.

History of Database Systems

1950s and early 1960s: Data processing using magnetic tapes for storage

Tapes provide only sequential access Punched cards for input

Late 1960s and 1970s: Hard disks allow direct access to data Network and hierarchical data models in widespread use

After 1970 : Ted Codd defines the relational data model High-performance (for the era) transaction processing

Page 9: Welcome to chapter 2 Chapter 2 Database Archetecture.

Hierarchical Database Model

Logically represented by an upside down tree Each parent can have many children Each child has only one parent

S63876S63874S63871E3102E1101R03R02E3501E1709E2101R01D02 S63876S63874S63871E3102E1101R03R02E3501E1709E2101R01D02

Page 10: Welcome to chapter 2 Chapter 2 Database Archetecture.

Network Database Model Each record can have multiple parents

Composed of sets Each set has owner record and member record Member may have several owners

Storage structure: linked list, dual linked list

Student dorm

students Teaching group

department

teachers

Page 11: Welcome to chapter 2 Chapter 2 Database Archetecture.

Relational Database Model

Storage structure: tables stored as files

Page 12: Welcome to chapter 2 Chapter 2 Database Archetecture.

History 1980s:

Research relational prototypes evolve into commercial systems SQL becomes industry standard

Parallel and distributed database systems Object-oriented database systems

1990s: Large decision support and data-mining applications Large multi-terabyte data warehouses Emergence of Web commerce

2000s: XML and XQuery standards Automated database administration Increasing use of highly parallel database systems Web-scale distributed data storage systems

Page 13: Welcome to chapter 2 Chapter 2 Database Archetecture.

Extending Database Capabilities

New functionality is being added to DBMSs in the following areas: Scientific Applications Image Storage and Management Audio and Video data management Data Mining Spatial data management Time Series and Historical Data Management

The above gives rise to new research and development in incorporating new data types, complex data structures, new operations and storage and indexing schemes in database systems.

Page 14: Welcome to chapter 2 Chapter 2 Database Archetecture.

Data Models A collection of tools for describing

Data structure Data operation Data constraints

Categories of data models:1.Conceptual (high-level, semantic) data models: Provide

concepts that are close to the way many users perceive data. Conceptual data models use concepts such as entities, attributes, and relationships. Entity-Relationship data model (mainly for database design)

m 讲授

组成成绩

选修课程

班级

学生

管理

m n

1

1

1 n

n

n

参考书教师

Page 15: Welcome to chapter 2 Chapter 2 Database Archetecture.

Slide 2-15

Categories of data models2. Physical (low-level, internal) data models: Provide concepts that de

scribe details of how data is stored in the computer by representing information such as record formats, record orderings, and access paths. An access path is a structure that makes the search for particular database records efficient.

3. Implementation (representational) data models: Provide concepts that fall between the above two, balancing user views with some computer storage details. The models used here are most frequently in traditional commercial DBMSs, and they include the widely-used relational data model, network and hierarchical ,Object-based data models (Object-oriented and Object-relational)

学生宿舍

学生 教研室

教师

Page 16: Welcome to chapter 2 Chapter 2 Database Archetecture.

Instances and Schemas

Similar to types and variables in programming languages Schema – the logical structure of the database

Example: The database consists of information about a set of customers and accounts and the relationship between them)

Analogous to type information of a variable in a program Instance – the actual content of the database at a particular

point in time Analogous to the value of a variable Student(studno,name,address) Course(courseno,lecturer)

Student(123,Bloggs,Woolton) (321,Jones,Owens)

Page 17: Welcome to chapter 2 Chapter 2 Database Archetecture.

Levels of Abstraction

Physical level: describes how a record (e.g., customer) is stored.

Logical level: describes data stored in database, and the relationships among the data.

type customer = record

customer_id : string; customer_name : string;customer_street : string;customer_city : string;

end;

View level: application programs hide details of data types. Views can also hide information (such as an employee’s salary) for security purposes.

Page 18: Welcome to chapter 2 Chapter 2 Database Archetecture.

View of DataAn architecture for a database system

Page 19: Welcome to chapter 2 Chapter 2 Database Archetecture.

Slide 2-19

Three-Schema Architecture

Mappings among schema levels are needed to transform requests and data. Programs refer to an external schema, and are mapped by the DBMS to the internal schema for execution.

• Logical Data Independence: The capacity to change the conceptual schema without having to change the external schemas and their application programs.

• Physical Data Independence: The capacity to change the internal schema without having to change the conceptual schema.

• When a schema at a lower level is changed, only the mappings between this schema and higher-level schemas need to be changed in a DBMS that fully supports data independence. The higher-level schemas themselves are unchanged. Hence, the application programs need not be changed since they refer to the external schemas.

Page 20: Welcome to chapter 2 Chapter 2 Database Archetecture.

Database Management System Internals

Storage management Query processing Transaction processing

Page 21: Welcome to chapter 2 Chapter 2 Database Archetecture.

Storage Management

Storage manager is a program module that provides the interface between the low-level data stored in the database and the application programs and queries submitted to the system.

The storage manager is responsible to the following tasks: Interaction with the file manager Efficient storing, retrieving and updating of data

Issues: Storage access File organization Indexing and hashing

Page 22: Welcome to chapter 2 Chapter 2 Database Archetecture.

Query Processing1. Parsing and translation

2. Optimization

3. Evaluation

Page 23: Welcome to chapter 2 Chapter 2 Database Archetecture.

Transaction Management

A transaction is a collection of operations that performs a single logical function in a database application

Transaction-management component ensures that the database remains in a consistent (correct) state despite system failures (e.g., power failures and operating system crashes) and transaction failures.

Concurrency-control manager controls the interaction among the concurrent transactions, to ensure the

consistency of the database.

Page 24: Welcome to chapter 2 Chapter 2 Database Archetecture.

Overall System Structure

Page 25: Welcome to chapter 2 Chapter 2 Database Archetecture.

Slide 2-25

DBMS Languages

• High Level or Non-procedural Languages: e.g., SQL, are set-oriented and specify what data to retrieve than how to retrieve. Also called declarative languages.

• Data Definition Language (DDL): Used by the DBA and database designers to specify the conceptual schema of a database.

• Data Manipulation Language (DML): Used to specify database retrievals and updates.

• Example: select age from student where name=‘Tom’

Page 26: Welcome to chapter 2 Chapter 2 Database Archetecture.
Page 27: Welcome to chapter 2 Chapter 2 Database Archetecture.

Database System Utilities

To perform certain functions such as:- Loading data stored in files into a database.- Backing up the database periodically on tape.- Reorganizing database file structures.- Report generation utilities.- Performance monitoring utilities.- Other functions, such as sorting , user monitoring , data compression , etc.Data dictionary / repository:- Used to store schema descriptions and other information such as design

decisions, application program descriptions, user information, usage standards, etc.

- Active data dictionary is accessed by DBMS software and users/DBA.- Passive data dictionary is accessed by users/DBA only.

Page 28: Welcome to chapter 2 Chapter 2 Database Archetecture.
Page 29: Welcome to chapter 2 Chapter 2 Database Archetecture.
Page 30: Welcome to chapter 2 Chapter 2 Database Archetecture.

Slide 2-30

DBMS Interfaces

• Stand-alone query language interfaces.• Programmer interfaces for embedding DML in

programming languages:• Pre-compiler Approach• Procedure (Subroutine) Call Approach

• User-friendly interfaces:• Menu-based, popular for browsing on the web• Forms-based, designed for naïve users• Graphics-based (Point and Click, Drag and Drop etc.)• Natural language: requests in written English• Combinations of the above

Page 31: Welcome to chapter 2 Chapter 2 Database Archetecture.

Slide 2-31

Other DBMS Interfaces

• Speech as Input (?) and Output• Web Browser as an interface• Parametric interfaces (e.g., bank tellers) using function

keys.• Interfaces for the DBA:

• Creating accounts, granting authorizations• Setting system parameters• Changing schemas or access path

Page 32: Welcome to chapter 2 Chapter 2 Database Archetecture.

Database ArchitectureThe architecture of a database systems is greatly influenced by

the underlying computer system on which the database is running: Centralized Client-server Parallel (multiple processors and disks)

Distributed

Page 33: Welcome to chapter 2 Chapter 2 Database Archetecture.

A physical centralized architecture.

Page 34: Welcome to chapter 2 Chapter 2 Database Archetecture.

Logical two-tier client/server architecture.

Page 35: Welcome to chapter 2 Chapter 2 Database Archetecture.

Physical two-tier client-server architecture.

Page 36: Welcome to chapter 2 Chapter 2 Database Archetecture.

Logical three-tier client/server architecture.

Page 37: Welcome to chapter 2 Chapter 2 Database Archetecture.

Classification of DBMSs

Based on the data model used:- Traditional: Relational, Network, Hierarchical.- Emerging: Object-oriented, Object-relational, Semi-structured

Other classifications:- Single-user (typically used with micro- computers) vs. multi-user

(most DBMSs).- Centralized (uses a single computer with one database) vs. - distributed (uses multiple computers, multiple databases)

Distributed Database Systems have now come to be known as client server based database systems because they do not support a totally distributed environment, but rather a set of database servers supporting a set of clients.

Page 38: Welcome to chapter 2 Chapter 2 Database Archetecture.

Summary

From this lecture you can learn : 1).Database Users

2).Benifits of Database

3).History of database

4).Data Model, Schema

5). Three-Schema Architecture

Page 39: Welcome to chapter 2 Chapter 2 Database Archetecture.

Any Questions?If there are any outstanding questions you can ask me one-to-one after the lecture OR privately in my office.

Page 40: Welcome to chapter 2 Chapter 2 Database Archetecture.

Exercises

1.what is three-schema architecture?