Part 3 of 5 · 1 min read
Why two-phase commit does not solve consensus
Two-phase commit depends on one coordinator; if that coordinator fails permanently, the system can be stuck forever with no way to proceed.
Think of the earlier wedding planner scenario. Now imagine the planner is permanently gone, with no backup planner and no way for the vendors to ever reach a decision among themselves.
In plain words: two-phase commit guarantees that all nodes reach the same decision, but it achieves that by relying entirely on a single coordinator to make and announce the decision. If that coordinator fails permanently, with no mechanism for another node to safely take over and determine what the decision should have been, the system can remain blocked indefinitely. A true consensus protocol improves on this by tolerating the failure of some nodes, including a coordinator-like role, and still reaching an agreed decision, as long as enough of the remaining nodes are working and can communicate.
A worked example. Two-phase commit's coordinator crashing permanently leaves every prepared node blocked forever, with no safe way to proceed. A consensus protocol handling the equivalent role instead continues making progress as long as a majority of its nodes remain reachable, even if the specific node that was leading the decision fails.
The key lines. No new SQL; the difference between two-phase commit and true consensus is a protocol-level distinction in how failure of the coordinating role is tolerated.
Fault-tolerant consensus
Fault-tolerant consensus is a consensus protocol that continues to make progress, reaching an agreed decision, even if some of its nodes fail, as long as enough of the remaining nodes stay reachable and functioning.
Example: a decision process that keeps working even after losing its current leading node, as long as a majority of participants remain, is fault-tolerant consensus.