Two-phase commit.
also: 2PC · two phase commit · XA transactionsA coordinator asks every participant to prepare, then tells all to commit (if all voted yes) or abort: atomic but blocking.
the two-minute refresher
- Phase 1 (prepare): every participant locks and votes READY or not.
- Phase 2: COMMIT if all are ready, otherwise ABORT.
- Blocking: locks are held until the decision; a crashed coordinator leaves participants stuck.
- Needs every service online at once, and many systems (Kafka, Stripe) don't support it: hence sagas.