2PC
Two-Phase Commit — classic distributed commit protocol. Phase 1: coordinator sends PREPARE to all participants, all reply Yes/No. Phase 2: if all Yes → COMMIT to all; if any No → ABORT to all.
Guarantees atomicity across multiple participants. Major problems: blocking protocol — if coordinator dies after PREPARE but before COMMIT, participants are stuck (locks held). Recovery requires coordinator recovery + complex protocol. Performance: 2 network roundtrips per commit + fsync per phase. Modern alternative: 3PC (Three-Phase Commit, addresses blocking but accepts lower availability), Paxos/Raft (consensus-based), Saga (no atomicity, compensate instead). Distributed DB (Spanner, CockroachDB) use optimized 2PC internally.