2PC
Two-Phase Commit (2PC) is a distributed algorithm used to ensure atomic commitment of a transaction across multiple nodes, or participants, in a distributed system. It guarantees that either the transaction is committed on all participants or it is aborted on all, preserving atomicity and consistency in the presence of failures. It is commonly used in distributed databases and resource managers that need cross-node transactional guarantees.
In 2PC, there are two phases. Phase one is the prepare (voting) phase. The coordinator sends a
The protocol relies on durable logging and reliable messaging. If the coordinator fails after the prepare messages
Variants and limitations include three-phase commit (3PC), which attempts to reduce blocking at the cost of