Distributed Transactions via Consensus

The introduction of this chapter mentioned that the consensus problem is very similar to the distributed transactions problem.

However, after studying the Paxos algorithm, one might think there seems to be a fundamental conflict between distributed transactions and the way Paxos solves the consensus problem.

The core characteristic of distributed transactions

The core characteristic of distributed transactions is atomicity. Either the relevant update has to be performed in all the nodes, or it should not be performed in any of them.

Difference between transaction problem and consensus problem

However, the Paxos algorithm relies on just a majority quorum to decide on a value. According to HadzilacosV. Hadzilacos, “On the Relationship between the Atomic Commitment and Consensus Problems,” Fault-Tolerant Distributed Computing, November 1990, pages 201–208, 1990., “Indeed, the problem of distributed transactions, known as atomic commit, and the consensus problem might be closely related. Still, they are not equivalent”.

  • The consensus problem mandates that every non-faulty node must reach the same decision, while the atomic commit problem requires that all the nodes (faulty or not) must reach the same decision.

  • The atomic commit problem imposes stricter relationships between votes or proposals and the final decision than the consensus problem.

  • In consensus, the only requirement is that the value that is agreed must have been proposed by at least one of the nodes. In atomic commit, a decision can be positive only if all the votes were positive. The decision is also required to be positive if all votes are positive and there are no failures.

Get hands-on with 1200+ tech skills courses.