What problem does the saga pattern solve in microservices?
Saga: coordinates a sequence of local transactions across services, using compensating actions instead of a single distributed transaction to maintain consistency.
2 / 5
What is a compensating transaction in a saga?
Compensation: when a later step fails, earlier committed steps are reversed with compensating transactions (e.g. refund a charge) since you cannot roll back across services.
3 / 5
How does choreography-based saga coordination work?
Choreography: services publish and subscribe to events, advancing the saga in a decentralized way. It is loosely coupled but can be hard to trace as it grows.
4 / 5
How does orchestration-based saga coordination differ?
Orchestration: a dedicated orchestrator drives the workflow, invoking services and triggering compensations on failure, giving clearer control flow at the cost of central coupling.
5 / 5
What consistency model does a saga provide?
Eventual consistency: because steps commit independently and are reconciled via compensation, the overall business invariant holds only after the saga completes, not instantaneously.