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
- Why distributed correctness is hard: the unknown outcome
- Idempotency keys on the API side
- Consumer-side idempotency: the inbox pattern and dedup windows
- Two-phase commit (2PC) — and why it blocks
- TC/C: Try-Confirm/Cancel
- Sagas: long-lived transactions with compensations
- Implementing an orchestrated saga as a persisted state machine
- Transactional outbox + CDC: killing the dual-write problem
- The exactly-once illusion
- Reconciliation: the safety net for money
- Scenario playbook: duplicate payments and duplicate orders
Previous: Consensus, Leader Election & Time · Next: Concurrency, Locking & Distributed Locks