Courses 0%
06
Distributed Systems And Algorithms · Chapter 6 of 51

Two-Phase and Three-Phase Commit

Akhil
Akhil Sharma
25 min

Two-Phase and Three-Phase Commit

The classic protocols for atomic commits across multiple databases — and why modern systems have largely moved away from them.


Key Takeaways

  1. 2PC coordinates atomic commits across multiple databases — a coordinator asks all participants to prepare, then commit or abort
  2. 2PC is blocking — if the coordinator fails after prepare, participants hold locks indefinitely until it recovers
  3. 3PC adds a pre-commit phase to reduce blocking — but still can't handle network partitions correctly
  4. Modern systems prefer Sagas over 2PC/3PC — Sagas trade atomicity for availability, using compensating transactions instead of distributed locks
ARCHITECT

Unlock with Architect

Unlock the full content and everything at this level.

Get Architect — $15/moAlready a member? Log in
Chapter complete!

Course Complete!

You've finished all 51 chapters of

System Design Advanced

Browse courses
Up next Quorum and Sloppy Quorum
Continue
preview