Idempotency, Distributed Transactions, 2PC & Sagas

Keeping money and orders correct across services: idempotency keys on both sides of every hop, 2PC and why it blocks, TC/C, sagas with compensations, transactional outbox + CDC, inbox dedup, the exactly-once illusion, and reconciliation.

About 100 minutes · 15 exam questions · 9 interview questions · 2 code labs

What you will learn

  1. Why distributed correctness is hard: the unknown outcome
  2. Idempotency keys on the API side
  3. Consumer-side idempotency: the inbox pattern and dedup windows
  4. Two-phase commit (2PC) — and why it blocks
  5. TC/C: Try-Confirm/Cancel
  6. Sagas: long-lived transactions with compensations
  7. Implementing an orchestrated saga as a persisted state machine
  8. Transactional outbox + CDC: killing the dual-write problem
  9. The exactly-once illusion
  10. Reconciliation: the safety net for money
  11. Scenario playbook: duplicate payments and duplicate orders

Previous: Consensus, Leader Election & Time · Next: Concurrency, Locking & Distributed Locks