Two-Phase Commit (2PC)
A protocol guaranteeing atomicity across multiple resources, involving a prepare and commit phase.
📜
The statement of the theorem
Let be the set of nodes. The Two-Phase Commit protocol proceeds through two phases:\n\n**Phase 1: Prepare (Voting)**\n1. . \n2. writes all necessary changes to stable storage (undo/redo logs) and replies if successful, or otherwise.\n\n**Phase 2: Commit/Abort (Decision)**\n1. If receives from all : . makes changes permanent.\n2. Otherwise: . rolls back changes.
Source: Wikipedia