Distributed Transactions: 2PC, Sagas & the Outbox

System Design · Advanced: Distributed Systems Deep Dive · Advanced · 25 min

Keep data consistent when one business action touches several services: why two-phase commit blocks, how sagas undo work with compensations, and how the outbox and idempotency keys make retries safe.

This lesson is part of TuringPath Pro. See plans.

What you will learn

  • Why one transaction across services is hard
  • Sagas: local steps plus compensations
  • The dual-write trap and the transactional outbox
  • Idempotency keys: making retries safe

More in Advanced: Distributed Systems Deep Dive

Previous: Consensus & Leader Election (Raft, Leases, Fencing) · Next: Clocks, Unique IDs & CRDTs