- Learn
- High Level System Design
- Distributed Transactions and Workflows
HLD-M10
Distributed Transactions and Workflows
Keeping data correct when one business action spans several services or databases: two-phase commit, sagas, workflow engines and reconciliation.
Booking a trip charges a card, reserves a flight and holds a hotel room, and each of those lives in a different service with its own database. There is no single transaction that covers them all, yet the business needs all of them to happen or none. This module is about that gap.
You will start with two-phase commit, the classic atomic protocol across databases, and see why it is rare between microservices. Then you will learn sagas, which trade atomicity for compensating actions, in both choreographed and orchestrated forms. Workflow engines such as Temporal and Cadence make those long-running processes durable. Finally, reconciliation jobs and double-entry bookkeeping catch the mistakes that every money-moving system eventually makes.
Lessons
- HLD-10.01 Two-phase commit Two-phase commit coordinates a transaction across several databases. Advanced 12 min
- HLD-10.02 Sagas: choreography and orchestration A saga breaks a business transaction into a sequence of local transactions, each with a compensating action that undoes it. Advanced 15 min
- HLD-10.03 Workflow engines Workflow engines such as Temporal and Cadence make long-running processes durable. Advanced 12 min
- HLD-10.04 Reconciliation and correctness jobs In any system that moves money or inventory, bugs and partial failures will eventually create mismatches. Advanced 8 min