Distributed Transactions: 2PC, Sagas & the Outbox
Keep data consistent across services without a global transaction. Lesson 9 of Level 9: Microservices.
Level 9 · Microservices · Lesson 9 of 13
Keep data consistent across services without a global transaction.
Continue learning
- Idempotency: Making Retries Safe — Previous lesson
- Observability: Logs, Metrics, Traces & SLOs — Next lesson
- Level 9: Microservices — Back to the level
Try it hands-on
- Distributed Transaction: Two-Phase Commit — Coordinate Order, Payment and Inventory with 2PC; crash participants or the coordinator at each phase.
- Saga: Compensating a Failed Checkout — Run a checkout saga as orchestration or choreography; fail any step and watch compensations unwind it.
- Transactions Lab — Isolation anomalies, lost updates and distributed transactions.
- Microservices Lab — Failures, retries, circuit breakers, sagas and idempotency.
All lessons in Microservices
- Why Microservices Exist — and When Not to Use Them
- Finding Service Boundaries & Splitting the Monolith
- Database per Service & Data Ownership
- Synchronous vs Asynchronous Communication
- API Gateways, BFFs & Service Discovery
- Timeouts, Retries & Retry Storms
- Circuit Breakers & Bulkheads
- Idempotency: Making Retries Safe
- Distributed Transactions: 2PC, Sagas & the Outbox
- Observability: Logs, Metrics, Traces & SLOs
- Deployment: Containers, Kubernetes, Canary & Feature Flags
- Testing Microservices & Consumer-Driven Contracts
- Teams, Ownership & Conway’s Law