Saga
ELI5 - The Vibe Check
A saga is a series of steps where each step has an undo action. If step 3 fails, you run the undo for steps 2 and 1. It's like an epic quest with a built-in retreat plan — if the dragon is too tough, you undo your journey town by town.
Real Talk
A pattern for managing distributed transactions across multiple microservices without a global ACID transaction. Each saga step executes a local transaction and publishes an event. If a step fails, compensating transactions are executed in reverse order to undo previous steps. Sagas can use choreography (events) or orchestration (coordinator).
When You'll Hear This
"The order saga: reserve inventory, charge payment, schedule delivery — if payment fails, release the inventory." / "Use choreography for simple sagas and orchestration when you need more control over the flow."
Related Terms
Choreography
Choreography is when services coordinate by reacting to each other's events without a central boss.
Distributed Systems
A distributed system is what you get when your application isn't running on one computer anymore, it's running on many computers that have to cooperate ove...
Event Sourcing
Instead of storing 'balance: $100', event sourcing stores 'deposited $200, withdrew $50, withdrew $50'.