<aside>
This section is part of the 5-hour Microservices course by Mukul Raina
Section 6: Distributed Transactions, Sagas, and Consistency
Section 5 established that each service owns its own database. This section confronts the hardest consequence of that rule: when a business operation spans multiple services, how do you keep data consistent across them without a shared transaction?
In a monolith, you wrap everything in a database transaction. If payment fails, the order is rolled back, inventory is released, and the database is consistent. In microservices, there is no shared transaction. Payment lives in one database, inventory in another, orders in a third. When payment fails after inventory has already been reserved, you need a strategy that goes far beyond BEGIN and ROLLBACK.
This section teaches that strategy. It is the highest-signal material in this course for senior-level interviews.
What We Will Cover:
Where This Appears in Real Systems:
Every time you place an order on a platform like Amazon, a saga coordinates order creation, inventory reservation, payment authorization, and shipment scheduling across independent services. When payment fails, compensating transactions release inventory. When shipping fails after payment, the system must decide between retrying, refunding, or escalating to a human operator. This is the reality of distributed consistency.