Chapter 3 · PDF file · 2013-02-28Chapter 3 - Objectives ... (tier 1) manages user...

38
1 Chapter 3 Database Architecture and the Web Pearson Education © 2009

Transcript of Chapter 3 · PDF file · 2013-02-28Chapter 3 - Objectives ... (tier 1) manages user...

1

Chapter 3

Database Architecture and the Web

Pearson Education © 2009

2

Chapter 3 - Objectives

Software components of a DBMS.

Client–server architecture and advantages of this type of architecture for a DBMS.

Function and uses of Transaction Processing Monitors.

Web-Services and Service-Oriented Architectures

Distributed DBMSs

Pearson Education © 2009

3

Components of a DBMS

DBMS is partitioned into several software

components/modules

– Assigned with to specific operation

– Design of a DBMS must take into account the interface between the

DBMS and the OS

Pearson Education © 2009

4

Components of a DBMSo Query processor

o a major DBMS component that transform

queries into a series of low-level

instructions directed to the db manager.

o Database Manager (DM)

o accepts queries & examines the external

& conceptual schemas to determine what

conceptual records are required to satisfy

the request

o DM places a call to the file manager to

perform the request.

o File manager

o manipulates the underlying storage files &

manages the allocation of storage space

on disk.

o It establishes and maintains the list used,

calls on the hashing functions to generate

record addresses.

o It passes the requests on to the appropriate

access methods(either read or write data

from system buffer)

Pearson Education © 2009

5

Components of a DBMSo DML preprocessor

o converts DML statements embedded in an

application program into standard function

calls in the host language

o DML processor must interact with the

query processor to generate the appropriate

code

o DDL compiler

o converts DDL statements into a set of

tables containing metadata.

o These tables are then stored in the system

catalog

o Catalog manager

o manages access to and maintains the

system catalog

Pearson Education © 2009

6

Components of Database Manager (DM)

Pearson Education © 2009

Authorization control –this module checks & confirms

whether the user has the necessary authorization to carry out

the required operation

Command processor –once the system confirmed the user

has authority to carry out operation, control is passed to the

command processor.

Integrity checker –for an operation that changes the db, the

integrity checker checks whether the requested operation

satisfies all necessary integrity constraints.

Query optimizer –determines an optimal strategy for the

query execution

Transaction manager –performs the required processing of

operations that it receives from transactions

Scheduler –responsible for ensuring that concurrent

operations on the db proceed without conflicting with one

another

Recovery manager –ensures that the db remains in a

consistent state in the presence of failure

Buffer manager –responsible for the transfer of data between

main memory & secondary storage (such as disk and tape)

7

Multi-User DBMS Architectures

Common architectures used to implement

multi-user database management systems:

– Teleprocessing

– File-server

– Client-server

Pearson Education © 2009

8

Teleprocessing

Traditional architecture.

Single mainframe with a number of terminals attached.

User terminals – dumb

– Incapable of functioning on their own

Pearson Education © 2009

9

File-Server

File-server is connected to several workstations across a network.

Database resides on file-server.

DBMS and applications run on each workstation.

Disadvantages include:

– Significant network traffic.

– Copy of DBMS on each workstation.

– Concurrency, recovery and integrity control more complex.

Pearson Education © 2009

10

File-Server Architecture

Pearson Education © 2009

•The processing is distributed

about the network (LAN)

•The file-server holds the files

required by the applications and

the DBMS

•Applications and the DBMS

run on each workstation

•File-server acts as a shared hard

disk drive

11

Traditional Two-Tier Client-Server

Client (tier 1) manages user interface and runs applications. (responsible for the presentation of

data to the user)

Server (tier 2) holds database and DBMS.(responsible for supplying data services to the client)

Advantages include:

– wider access to existing databases;

– increased performance;

– possible reduction in hardware costs;

– reduction in communication costs;

– increased consistency.

Pearson Education © 2009

12

Traditional Two-Tier Client-Server

Pearson Education © 2009

•The client takes the user’s request, checks the

syntax, and generates database requests in SQL

•Then transmits the message to the server, waits for a

response, and formats the response for the end-user.

•The server accepts and processes the database

requests, then transmits the results back to the client.

•The processing involves checking authorization,

ensuring integrity, maintaining the system catalog,

query and update processing.

13

Traditional Two-Tier Client-Server

Pearson Education © 2009

14

Three-Tier Client-Server

In two tier client-server, client side presented

two problems preventing true scalability:

– ‘Fat’ client, requiring considerable resources on

client’s computer to run effectively.

– Significant client-side administration overhead.

By 1995, three layers proposed, each

potentially running on a different platform.

Pearson Education © 2009

15

Three-Tier Client-Server

The three layers:

– User interface layer

– Business logic and data processing layer:

Application Server

– DBMS-stores data required by middle tier:

Database Server

Pearson Education © 2009

16

Three-Tier Client-Server

Advantages:

– ‘Thin’ client, requiring less expensive hardware.

– Application maintenance centralized.

– Easier to modify or replace one tier without

affecting others.

– Separating business logic from database functions

makes it easier to implement load balancing.

– Maps quite naturally to Web environment.

Pearson Education © 2009

17

Three-Tier Client-Server

Pearson Education © 2009

18

Transaction Processing Monitors

Program that controls data transfer between clients and

servers in order to provide a consistent environment,

particularly for Online Transaction Processing (OLTP).

Middleware component that provides access to the

services of a number of resource managers (DBMSs,

OS, User interfaces, messaging software)

Provide a uniform interface for programmers who are

developing transactional software (Software that

guarantees that all appropriate databases are updated from

a single transaction)

Pearson Education © 2009

19

Transaction Processing Monitors

Advantages:

– Transaction routing: increase scalability by directing

transactions to specific DBMSs

– Managing distributed transactions: manage transactions

that require access to data held in multiple, possibly

heterogeneous DBMSs.

– Load balancing: balance client request across multiple

DBMSs

– Funneling: handle large users

– Increased reliability: act as Transaction Manager,

performing necessary actions to maintain the

consistency of the database

Pearson Education © 2009

20

TPM as middle tier of 3-tier client-server

Pearson Education © 2009

21

Web Services

A software system designed to support

interoperable machine-to-machine interaction

over a network

Examples:

– Microsoft Virtual Earth Web services

– Amazon S3

– Geonames

– DOTS web services

Pearson Education © 2009

22

Web Services: Microsoft Virtual Earth

Web services

Offer static map images

match addresses to the map, search for points of

interest, integrate maps and imagery, return

driving directions, and incorporate other location

intelligence into your Web application.

Pearson Education © 2009

23

Web Services: Microsoft Virtual Earth

Web services

Pearson Education © 2009

24

Web Services: Microsoft Virtual Earth

Web services

Pearson Education © 2009

25

Web Services: Microsoft Virtual Earth

Web services

Pearson Education © 2009

26

Web Services: Amazon S3

Simple web services interface

Can be used to store and retrieve large amounts of

data from anywhere on the web

Give developer access to the same highly scalable,

reliable, fast, inexpensive data storage

infrastructure

Pearson Education © 2009

27

Web Services: Amazon S3

Pearson Education © 2009

28

Web Services: Geonames

Pearson Education © 2009

29

Web Services: DOTS web services

Pearson Education © 2009

30

Web Services: DOTS web services

Pearson Education © 2009

Web Services

Use these technologies and standards:

– XML

– SOAP (Simple Object Access Protocol) – communication

protocol for exchanging structured information over the

Internet and uses a messages format based on XML

– WSDL (Web Services Description Language) protocol –

based on XML, used to describe and locate a Web service.

– UDDI (Universal Discovery, Description and Integration)

protocol – platform-independent , XML-based registry for

businesses to list themselves on the Internet.

32

Web Services

Pearson Education © 2009

Web Service Web service

directory (UDDI)

XML Interface

(WSDL)

WSDL

documents

Client

Application

XML Interface

(WSDL)

Internet

2. Publish

1. Generate

3. Find

4. Invoke

SOAP

33

Web Services

The growing success of Web services is due to

a number of factors, including those below. – Systems can interact with one another dynamically via

standard Internet technologies.

– Services are built once and reused many times.

– Services can be implemented in any programming language.

– Service consumers do not need to worry about firewalls

because communication is carried over HTTP.

– Systems can advertise their capabilities for other systems to

use.

Pearson Education © 2009

34

Distributed Database and DBMS

Distributed Database– A logically related collection of shared data (and

description of this data), physically distributed over a computer network

Distributed DBMS– The software system that permits the management of the

distributed database and makes the distribution transparent to user

Distributed Processing– A centralized database that can be accessed over a

computer network

Pearson Education © 2009

35

Distributed DBMS

Pearson Education © 2009

Computer

Network

Site 1

Site 2 Site 3

DB

DBDB

36

Characteristics of DDBMS

A collection of logically related shared data

Data split into a number of fragments

Fragments may be replicated

Fragments/replicas are allocated to sites

Sites are linked by a communication network

Data at each site is under control of a DBMS

DBMS at each site can handle local applications autonomously

Each DBMS participates in at least one global application

Pearson Education © 2009

37

Data Warehousing

A consolidated/integrated view of corporate data

drawn from disparate operational data sources and

a range of end-user access tools capable of

supporting simple to highly complex queries to

support decision making

Pearson Education © 2009

38

Data Warehousing Architecture

Pearson Education © 2009

Warehouse Manager

Warehouse Manager

Load

Manager

Query

Manager

Operational

Data Source 1

Archive/Back

up Data

Operational

Data Source 2

Operational

Data Source 3

Operational

Data Source 4

Metadata

Detailed Data

Lightly

Summarized

Data

Highly

Summarized

Data

Reporting, query,

application development

and EIS tools

OLAP tools

Data Mining tools

End-user Access Tools