Showing posts with label Distributed Database Questions. Show all posts
Showing posts with label Distributed Database Questions. Show all posts

Tuesday, July 5, 2016

What is the major disadvantage of 2PC protocol?


What is the major disadvantage of 2PC protocol? Define blocking problem in distributed database



Blocking problem – In case of coordinator failure, Two Phase Commit (2PC) protocol uses various ways to complete the transaction (to abort or commit). It can be done using the messages found in the log files of participating sites. If all the participating sites have <ready T> message and no other control messages (such as <abort T> or <commit T>) then all the active sites which are participating in that transaction have to wait for their transaction coordinator to recover. 
The transaction T can be aborted or committed only if the failed transaction coordinator is restarted/come alive. This situation is called blocking problem.



********************





Saturday, August 9, 2014

Advantages and Disadvantages of Three Phase Commit Protocol

Advantages and Disadvantages of 3PC Protocol


Advantages of 3PC Protocol


  • The Blocking problem found in 2PC can be avoided (in certain occasions, especially when at least not more than k sites failed)

Disadvantages of 3PC Protocol


  • Network partitions (network segments) would cause Blocking Problem, especially if more than k sites are part of any partitions.  
  • Long latency due to the number of messages to be transferred between sites on taking decision. That is, it involves 3 phases and all the 3 phases involve communication between sites.
********

Three Phase Commit (3PC) Protocol - External Link



Three phase commit protocol
advantages of 3PC protocol in distributed databases
disadvantages of three phase commit (3PC) protocol in distributed database

Database Recovery in Distributed Database

Question 4

Figure 1 - Execution of Transaction T in a distributed environment

Figure 1 shows a distributed database configured on sites A, B, C, and D. All the sites are connected. Assume that a request in the form of Transaction T is reaching Site A. For this case represented in Figure 1, answer the following questions;
(a) How do you handle and restore(recover) the database if Site A is failed during transaction T? Explain.
(b) How do you handle and restore(recover) the database if Site B is failed during transaction T? Explain.
(c) Assume that the Site C is failed. When it recovers from failure, it reads <ready T> control message for transaction T in its log file. How would site C restore the database using the <ready T> control message?
(d) Assume that the Site C is failed. When C recovers, it checks the log file for deciding the fate of the transactions that were running during failure. This step is very much necessary as it can lead the database to a consistent state. When you check the log file, what are the different cases or log entries which would force you to perform an Undo(T) (undo a transaction) on your own without consulting the other sites?

Answer

Click on the links to further view the answers;
 
(a) Transaction T is initiated at Site A. Hence, Site A is the Transaction Coordinator site according to the information provided and the given figure. Now, the other sites which are participating in Transaction T can execute the routine of 2PC protocol for handling the Coordinator Failure. For explanation, continue with the link.

(b) According the information provided, Site B is one of the participating site in Transaction T. Hence, the algorithm for handling Site Failure can be invoked and the database could be set right. For explanation, continue with the link.

(c) The appropriate solution for this case is to invoke the Handling of Site Failure routine. As Site C reads a <ready T> message, Site C, in any case cannot decide the fate of Transaction T. Hence, it has to approach other sites including the Coordinator site to know the decision on Transaction T. 

(d) There are two cases;
  • If the Site C has a record with <abort T>, it has to perform an Undo(T)
  • If the Site C does not contain any control messages (no abort, commit, or ready), it has to perform an Undo(T)





 

Distributed Databases Questions and Answers


Questions and Answers in Distributed Database Management System / Distributed Database Question and Answers / Practice Exam Questions with Answers in Distributed Database / Advanced Database Systems Questions and Answers

Questions and Answers in Distributed Database Management System



Data Fragmentation and Replication

Distributed Transactions

Commit Protocols to handle Distributed Transactions

Concurrency Control in Distributed Database

Deadlock Handling in Distributed Database

Availability and Robustness

Distributed Query Processing

Others





Featured Content

Multiple choice questions in Natural Language Processing Home

MCQ in Natural Language Processing, Quiz questions with answers in NLP, Top interview questions in NLP with answers Multiple Choice Que...

All time most popular contents

data recovery