Systems & Backend

Two-Phase Commit

also: 2PC · atomic commit

All-or-nothing across systems: everyone votes, then everyone commits — at the price of blocking.

2PC makes one transaction span systems: a coordinator asks all participants to prepare (vote yes and hold locks), then broadcasts commit or abort. Atomic, but blocking — a dead coordinator strands participants holding locks. That fragility is why the microservices world usually prefers sagas: local transactions plus compensating actions, trading atomicity for availability.