Vous êtes sur la page 1sur 37

Distributed Data Base Management System

Unit 3

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Vaibhav Singhal, Asst. Professor

U2.1

UNIT 3
Management of Distributed Transactions 2 phase unit protocols, Architectural aspects, Node and link failure recoveries, Distributed data dictionary management, Distributed database administration.

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2.2 U3.2

2 phase Commit protocol


Two-Phase Commit (2PC): All sites (local transaction managers) participating in global transaction decide whether to globally commit/abort transaction. All local decision are collected at one site (coordinator). This site also makes the final decision with respect to global commit/abort. Execution of the protocol is initiated by coordinator after the last step of the global transaction has been reached. Note that when the protocol is initiated, the transaction still may be executing at some local sites.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer
U2.3 U3.3

2 Phase Commit Diagram

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2.4 U3.4

Phase 1: Coordinator gets the participants ready to write the results into the database Phase 2: Everybody writes the results into the database Coordinator: The process at the site where the transaction originates and which controls the execution Participants: Processes at the other sites that participate in executing the transaction.

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2.5 U3.5

Global Commit Rule:


1. Coordinator aborts a transaction if and only if at least one participant votes to abort it. 2. Coordinator commits a transaction if and only if all participants vote to commit it.

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2.6 U3.6

How this algorithm works


Election Message: An Election Message is sent by the site to the site with higher site ids after detection of the failure of the coordinator site. Co-ordinator message: Co-ordinator message are send by the newly elected coordinator to the sites with lowest site ids.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer
U2.7 U3.7

The Algorithm works as follows


1. Detection of the failure of the coordinator: When a site sends a request to the coordinator and the coordinator does not reply with in the specified time limit the sender detects the failure of the coordinator.

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2.8 U3.8

The Algorithm works as follows


2. Election When any site has detected the failure of the coordinator its sends election message (to sites with higher site ids). When such a message is received by any process it sends and I am still alive message to the sender and contests a new election.

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2.9 U3.9

The Algorithm works as follows


If the sender of the election message receives even a single I am still alive message It understands that a site with higher site id is still alive and there fore drops as the contender of the coordinator election.

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 10 10

The Algorithm works as follows


In case a site after sending election message does not receive any message from any of the site it takes over as the new coordinator. 3. Coordinator Once being elected the new coordinator sends the coordinator message to all the other processes.

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 11 11

Conditions for site failure

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 12 12

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 13 13

Site failure in 2 PC

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 14 14

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 15 15

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 16 16

Architectural Aspects

Communication structure for Commit protocols.

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 17 17

Centralized
Centralized 2 1 3 4
(Prepare) (Ready or Abort)

2 1 3 4 1

(Commit or Abort)

ACk
U2. U3. 18 18

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

Hierarchical
3 2 1 4 2 1 5
(Prepare)

3 2 4 1 2

5
ACK

(Ready or Abort) (commit or Abort)

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 19 19

Linear
(Prepare and Ready) 1 2 (Commit or Abort) 3

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 20 20

Distributed
1 1

2 3

3
(Prepare) (Commit or Abort)

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 21 21

Node and link failure recoveries in Distributed Databases

Distributed Databases suffer from Communication Failure The failure that are observed in Centralized data bases.

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 22 22

Failure and recoveries in Distributed Databases

To handle communication failures a time out mechanism can be used for the detection of the failure, and some networking protocols can be deployed for further resolving the failures. The other failures which may arises in a distributed data base are Transaction failure System failure Media failure
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer
U2. U3. 23 23

Failure and recoveries in Distributed Databases Transaction failure: This is said to be occur when transaction is made to abort while it was still under progress. System failure: This is said to be occur when, while a transaction is being saved, before all the changes were successfully transferred to the secondary storage the system crash. Media Failure: A media failure is said to occur when the secondary storage being used for the storage of data under goes failure.

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 24 24

Failure and recoveries in Distributed Databases

The transaction failures do not lead a database towards any in consistency if a deferred update scheme is used. The changed made by the transaction were still in the buffer and there fore aborting the transaction would not in any way affect the physical data base. On the other hand media failures can only be handled using some efficient and reliable back up schedules or implementation of stable storage.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer
U2. U3. 25 25

Failure and recoveries in Distributed Databases

Handling system failure can be carried out using some logging technique. A transaction logs is a history of events that occurred on a data base, While the transaction is making changes to the data base it stores a log record in the transaction log. Physically the logs are maintained as files on the secondary storage the active log is brought in to the buffer and it is the active log which keeps a track of the changes attempted to by the transaction.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer
U2. U3. 26 26

Failure and recoveries in Distributed Databases

Under distributed databases transaction logs are maintained locally on each site, If the site are fully autonomous then the log of the site which initiate some Query is considered as the master log and for the purpose of recovery this master log will be used.

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 27 27

Distributed Data Base Administration

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 28 28

Distributed Data Base Administration

Database administration refers to a variety of activities for the development, control, maintenance of the database application.

The task of global database administrator are not different from those of the administrator of a centralized database, performing these tasks involves more complication as compare to centralized databases.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer
U2. U3. 29 29

Distributed Data Base Administration Tasks of distributed database administrator are very limited, since every site is independently administrated. Functions of Distributed DBA are: Catalog Management Object Naming Authorization and Protection
U2. U3. 30 30

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

Authorization and Protection


1. Site to Site Protection: Protection is required when during inter site communication. At the other side of the communication line is the intended site. No intruder can either read or manipulate the messages which are exchanged between the sites.

Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer

U2. U3. 31 31

Authorization and Protection


2. User Identification: When a user connects to the database system, he or she must be identified by the system; the identification is a crucial aspect of preserving security, because if an intruder could pretend to be a valid user, then security would be violated. Assuming a password mechanism, identification requires the password provided by the user to match the password available to the system.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer
U2. U3. 32 32

Authorization and Protection


3. Enforcing Authorization Rules Once users are properly identified, database systems can use authorization rules to regulate the actions performed upon database objects by them . In a distributed environment, additional problems include the allocation of these rules, which are part of the catalog.
Two alternatives are: Fully replication of authorization rules. Allocation of authorization rules at the same sites as the objects to which they refer.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer
U2. U3. 33 33

Authorization and Protection


4. Classes of Users

This mechanism deal with authorization and the amount of stored information, individual users are typically grouped into classes, which are all granted the same privileges. For instances, all employees of the administration department constitute a class, and all employees of the manufacturing department constitute a different class. Users of the first class can access information about employee salaries, while those of the second class. t can access information about project management.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer
U2. U3. 34 34

Authorization and Protection


In distributed databases, the following considerations apply to classes of users:
A natural classification of users is the one which is induced by the distribution of the database to different sites; if is likely that all users at site x have the same common properties from the view point of authorization. An example of naming mechanism for this class should be provided public@Site_X to denote all users of Site X.
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer
U2. U3. 35 35

Short Questions
Write some points to manage distributed transactions? Give different type of Architectural aspects in DDBMS? Explain the cases where DDBMS has failure possibility . How Distributed database administrator is different from database administrator. Explain the term Distributed data base dictionary management?
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer
U2. U3. 36 36

Long Questions
Explain the functions of Distributed data base Administrator? Explain the functioning of two phase and three phase commit protocols in distributed databases. What are different kind of architectural aspects in distributed data base management system ? Explain the different type of failures which can occur in a distributed system. How 2 phase commit protocols handle these failures?
Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63, byVaibhav Singhal, Asst. Professor Bharati Vidyapeeths Institute of Computer Applications and Management, New Delhi-63,By Divya Goel, Lecturer
U2. U3. 37 37

Vous aimerez peut-être aussi