Lecture 08 distributed dbms

37
Lecture 8 Distributed Database Management Systems

description

 

Transcript of Lecture 08 distributed dbms

Page 1: Lecture 08 distributed dbms

Lecture 8

Distributed Database Management Systems

Page 2: Lecture 08 distributed dbms

2

Centralized database System

Different Types of Database System

Contributed by: Isha KushwahMCA-2008-11

Page 3: Lecture 08 distributed dbms

3

Content

• What a distributed database management system (DDBMS)

• DDBMS components• Database implementation is affected by different

levels of data and process distribution• How transactions are managed in a distributed

database environment• How database design is affected by the

distributed database environment

Page 4: Lecture 08 distributed dbms

5

Problem in Centralized database Management

• Performance degradation• High cost• Reliability problems

Page 5: Lecture 08 distributed dbms

6

DDBMS Advantages

• Data located near site with greatest demand• Faster data access• Faster data processing• Growth facilitation• Improved communications• Reduced operating costs• User-friendly interface• Less danger of single-point failure• Processor independence

Page 6: Lecture 08 distributed dbms

7

DDBMS Disadvantages

• Complexity of management and control• Security• Lack of standards• Increased storage requirements• Greater difficulty in managing data environment• Increased training costs

Page 7: Lecture 08 distributed dbms

8

Distributed Processing Shares database’s logical processing among

physically, networked independent sites

Figure 10.1

Page 8: Lecture 08 distributed dbms

9

Distributed Database Stores logically related database over physically

independent sites

Figure 10.2

Page 9: Lecture 08 distributed dbms

10

Distributed Database vs. Distributed Processing

• Distributed processing – Does not require distributed database

– May be based on a single database on single computer

– Copies or parts of database processing functions must be distributed to all data storage sites

• Distributed database – Requires distributed processing

• Both – Require a network to connect components

Page 10: Lecture 08 distributed dbms

11

Functions of DDBMS

• Application/end user interface• Validation• Transformation• Query optimization• Mapping• I/O interface• Formatting • Security• Backup and recovery• DB Administration• Concurrency Control• Transaction Management

Page 11: Lecture 08 distributed dbms

13

Centralized Database

Figure 10.3

Page 12: Lecture 08 distributed dbms

14

Fully Distributed Database Management System

Figure 10.4

Page 13: Lecture 08 distributed dbms

15

DDBMS Components

• Computer workstations • Network hardware and software components• Communications media• Transaction processor (TP)

– Also called application manager (AP) or transaction manager (TM)

• Data processor (DP)– Also called data manager (DM)

Page 14: Lecture 08 distributed dbms

16

Distributed Database Components

Figure 10.5

Page 15: Lecture 08 distributed dbms

17

DDBMS Protocols

• Interface with network to transport data and commands between DPs and TPs

• Synchronize data received from DPs and route to appropriate TPs

• Ensure common database functions – Security

– Concurrency control

– Backup and recovery

Page 16: Lecture 08 distributed dbms

18

Levels of Data and Process Distribution

Database systems can be classified based on process distribution and data distribution

Table 10.1

Page 17: Lecture 08 distributed dbms

19

Single-Site Processing, Single-Site Data (SPSD)

• All processing on single CPU or host computer• All data are stored on host computer disk• DBMS located on the host computer• DBMS accessed by dumb terminals• Typical of mainframe and minicomputer DBMSs• Typical of 1st generation of single-user

microcomputer database

Page 18: Lecture 08 distributed dbms

20

Single-Site Processing, Single-Site Data (con’t.)

Figure 10.6

Page 19: Lecture 08 distributed dbms

21

Multiple-Site Processing, Single-Site Data (MPSD)

• Requires network file server• Applications accessed through LAN• Variation known as client/server architecture

Figure 10.7

Page 20: Lecture 08 distributed dbms

22

Multiple-Site Processing, Multiple-Site Data (MPMD)

• Fully distributed DDBMS with support for multiple DPs and TPs at multiple sites– Homogeneous I

• Integrate one type of centralized DBMS over the network

– Heterogeneous • Integrate different types of centralized DBMSs over a

network

Page 21: Lecture 08 distributed dbms

23

Heterogeneous Distributed Database Scenario

Figure 10.8

Page 22: Lecture 08 distributed dbms

24

Distributed DB Transparency

• Allows end users to feel like only database user• Hides complexities of distributed database• Transparency features

– Distribution

– Transaction

– Failure

– Performance

– Heterogeneity

Page 23: Lecture 08 distributed dbms

25

Distribution Transparency

• Allows management of a physically dispersed database as though it were centralized

• Three Levels – Fragmentation transparency– Location transparency– Local mapping transparency

Table 10.2

Page 24: Lecture 08 distributed dbms

26

Transaction Transparency

• Ensures transactions maintain integrity and consistency

• Completed only if all involved database sites complete their part of the transaction

• Management mechanisms– Remote request

– Remote transaction

– Distributed transaction

– Distributed request

Page 25: Lecture 08 distributed dbms

27

Remote Request

Figure 10.10

Page 26: Lecture 08 distributed dbms

28

Remote Transaction

Figure 10.11

Page 27: Lecture 08 distributed dbms

29

Distributed Transaction

Figure 10.12

Page 28: Lecture 08 distributed dbms

30

Distributed Requests

Figure 10.13

Page 29: Lecture 08 distributed dbms

31

Distributed Requests (con’t.)

Figure 10.14

Page 30: Lecture 08 distributed dbms

32

Distributed Concurrency Control

• Multisite, multiple-process operations more likely to create data inconsistencies and deadlocked transactions

• Problems– Transaction committed by local DP

– One DP could not commit transaction’s result

– Yields inconsistent database

Page 31: Lecture 08 distributed dbms

33

Two-Phase Commit Protocol

• DO-UNDO-REDO protocol– Write-ahead protocol

– Two kinds of nodes• Coordinator

• Subordinates

• Phases– Preparation

• Coordinator sends message to all subordinates

• Confirms all are ready to commit or abort

– Final Commit• Ensures all subordinates have committed or aborted

Page 32: Lecture 08 distributed dbms

34

Performance Transparency and Query Optimization

• Objective: Minimize total cost associated with execution of request

• Main costs– Access time – Communication – CPU time

• Basis for query optimization algorithms

– Optimum execution order– Sites accessed to minimize communication costs

• Automatic or Manual• Dynamic or static optimization• Statistically based vs. rule-based query optimization

algorithms

Page 33: Lecture 08 distributed dbms

35

Distributed Database Design

• Partition database into fragments– Horizontal

– Vertical

– Mixed

• Fragments to replicate– Storage of data copies at multiple sites

– Fully, partially, unreplicated databases

• Data allocation– Where to locate data

– Centralized, partitioned, replicated

Page 34: Lecture 08 distributed dbms

36

Client/Server Advantages Over DDBMS

• Client/server less expensive• Client/server solutions allow use of

microcomputer’s GUI• More people with PC skills than mainframe skills• PC is well established in workplace• Numerous data analysis and query tools exist • Considerable cost advantages to off-loading

application development

Page 35: Lecture 08 distributed dbms

37

Client/Server Disadvantages

• Creates more complex environment with different platforms

• Increased number of users and sites creates security problems

• Training issues become more complex and expensive

Page 36: Lecture 08 distributed dbms

38

Date’s 12 Commandments for Distributed Databases

1. Local Site Independence

2. Central Site Independence

3. Failure Independence

4. Location Transparency

5. Fragmentation Transparency

6. Replication Transparency

Page 37: Lecture 08 distributed dbms

39

Date’s 12 Commandments for Distributed Databases

7. Distributed Query Processing

8. Distributed Transaction Processing

9. Hardware Independence

10. Operating System Independence

11. Network Independence

12. Database Independence