Open In App

Transaction Recovery in Distributed System

Transactions may be performed effectively using distributed transaction processing. However, there are instances in which a transaction may fail for a variety of causes. System failure, hardware failure, network error, inaccurate or invalid data, application problems,  are all probable causes. Transaction failures are impossible to avoid. These failures must be handled by the distributed transaction system. When mistakes arise, one must be able to identify and correct them. Transaction Recovery is the name for this procedure. In distributed databases, the most difficult procedure is recovery. It is extremely difficult to recover a communication network system that has failed.

Let us consider the following scenario to analyze how transaction fail may occur. Let suppose, we have two-person X and Y. X sends a message to  Y and expects a response, but Y is unable to receive it. 



The following are some of the issues with this circumstance:

Distributed commit in the network is another major issue that can wreak havoc on a distributed database’s recovery.



One of the most famous methods of Transaction Recovery is the “Two-Phase Commit Protocol”. The coordinator and the subordinate are the two types of nodes that the Two-Phase Commit Protocol uses to accomplish its procedures. The coordinator’s process is linked to the user app, and communication channels between the subordinates and the coordinator are formed. 

The two-phase commit protocol contains two stages, as the name implies. The first step is the PREPARE phase, in which the transaction’s coordinator delivers a PREPARE message. The second step is the decision-making phase, in which the coordinator sends a COMMIT message if all of the nodes can complete the transaction, or an abort message if at least one subordinate node cannot. Centralized 2PC, Linear 2PC, and Distributed 2PC are all ways that may be used to perform the 2PC.

Article Tags :