Problem Statement
What does Two-Phase Commit (2PC) coordinate across?
Explanation
2PC uses a prepare phase to ensure all participants can commit, then a commit phase to finalize atomically. It provides ACID across systems at the cost of latency and blocking under failures.
Modern systems also use consensus replication to achieve similar guarantees.
Code Solution
SolutionRead Only
-- Coordinator: PREPARE TRANSACTION 'tx1'; then COMMIT PREPARED 'tx1';
Practice Sets
This question appears in the following practice sets:
