Quick revision
The short answer
Both are sagas: a sequence of local transactions in which each step has a compensating action if a later step fails. In a choreographed saga each service listens for events and emits its own, with no central coordinator, which is simple for a few steps but makes the flow hard to see and change. In an orchestrated saga a coordinator such as an order saga service sends commands and tracks state, so the flow is explicit and easier to monitor. Either way, compensations are semantic undos like refunds that must be idempotent, and sagas give no isolation.
What to remember
In this answer, we saw that a saga is a sequence of local transactions with a compensating action for each step. In choreography, services react to each other's events with no coordinator, which is light for a few steps but spreads the flow across codebases. In orchestration, a coordinator sends commands and stores the saga's state, which makes the flow explicit and easy to monitor at the cost of an extra component. In both, compensations are idempotent semantic undos such as refunds, and intermediate states are visible to others because sagas give no isolation.
Your turn
Answer it aloud as you would in the interview, or type your answer below. Then show one part at a time and compare.
Both are sagas: a sequence of local transactions in which each step has a compensating action if a later step fails. In a choreographed saga each service listens for events and emits its own, with no central coordinator, which is simple for a few steps but makes the flow hard to see and change. In an orchestrated saga a coordinator such as an order saga service sends commands and tracks state, so the flow is explicit and easier to monitor. Either way, compensations are semantic undos like refunds that must be idempotent, and sagas give no isolation.
Why this question is asked
Once an order flow spans a stock service, a payment service and a shipping service, there is no single database transaction that can cover it. Sagas are the standard answer, and the choice between choreography and orchestration is one of the first design decisions a team makes. Interviewers ask it to see whether we understand what a saga is, how failures are undone, and what each style costs as the flow grows. In this answer, we will recap the saga idea, walk through the order flow both ways with its failure path, compare them, and look at the two properties every saga shares: semantic compensations and the lack of isolation.
1A Quick Recap of Sagas
A saga is a business process split into steps, where each step is a local transaction in one service, committed on its own. Here the steps are reserve stock in the inventory service, charge the card in the payment service, and schedule shipping in the shipping service. Because each step commits independently, we cannot roll the whole thing back like a database transaction. Instead, each step that can be undone has a compensating action, a new transaction that reverses its business effect: release the stock, refund the charge.
If shipping fails, for example because the address is undeliverable, the saga runs the compensations of the steps that already completed, in reverse order: refund the card, then release the stock. The order ends either fully done or fully compensated.
2The Order Flow as a Choreography
In choreography, there is no coordinator. Each service subscribes to the events it cares about and publishes its own events when it finishes. The order service publishes OrderPlaced. Inventory hears it, reserves stock and publishes StockReserved. Payment hears that, charges the card and publishes PaymentCharged. Shipping hears that and publishes ShippingScheduled, and the order service marks the order confirmed.
9 messages in order. Play them, or step through them one at a time.
Each service reacts to events; the failure path is spread across all of them.
Notice that each service must know which events trigger its next step and which trigger its compensation. Nothing in the system holds the whole flow; it exists only as the sum of every service's subscriptions. With three steps this is easy to follow and has very little infrastructure. With seven, a reader has to open seven codebases to see what happens on failure, and changing the order of steps means coordinated changes in several teams.
3The Same Flow as an Orchestration
In orchestration, a coordinator, here an order saga service or a component inside the order service, owns the flow. It sends commands, waits for replies and records the saga's state in its database after each step.
The services become simpler: each one handles commands for its own step and its own compensation, without knowing what comes next. The flow is written in one place, so it is easy to read, test and change, and the state table shows exactly where every order is. The cost is a new component that must be built, deployed and kept highly available, and some risk that business logic drifts into the orchestrator instead of staying in the services.
4Comparing the Two Styles
The difference is where the flow lives: spread across event subscriptions, or written in one coordinator. That decides how easy it is to see, change and monitor the process.
| Aspect | Choreography | Orchestration |
|---|---|---|
| Who drives the flow | each service reacts to events | a coordinator sends commands |
| Seeing the whole flow | only by reading every service | in one place, with stored state |
| Changing the order of steps | changes in several services | change the orchestrator |
| Monitoring a stuck order | trace events across services | query the saga state table |
| Extra infrastructure | none beyond the broker | orchestrator service or engine |
| Good fit | two to four simple steps | many steps, frequent changes |
5Compensations Are Semantic Undos
A compensation is not a database rollback. The charge really happened, the customer may have seen it on their banking app, and the refund is a new business event with its own record. That is why we call it a semantic undo: it reverses the meaning, not the bytes. Some steps cannot be undone at all, such as an email already sent, so we put them last or accept a follow-up apology email as the compensation.
Compensations must also be idempotent, safe to run more than once, because messages are delivered at least once and the coordinator retries after timeouts. A refund command processed twice must not refund twice; the payment service checks whether this charge is already refunded and simply confirms.
6Sagas Give No Isolation
Because each step commits immediately, other transactions can see the intermediate states. Between reserving stock and the failed shipping, another customer may have been told the item is out of stock, and a report may have counted the charge as revenue. This is the missing I in ACID, and it is the main way sagas differ from a real distributed transaction.
We handle it by design rather than by locks: mark records with a pending state, such as an order in PAYMENT_PENDING or stock in RESERVED rather than SOLD, so readers know the value may still change, and order the steps so that the ones most likely to fail come first.
7Follow-up questions
Which approach would you choose for a flow with seven steps?
Orchestration. With seven steps the failure paths multiply, and in a choreography nobody can see the whole flow or change it without touching several services. An orchestrator, or a workflow engine such as Temporal or Camunda if the flow is long-running, keeps the steps and compensations in one place, stores the state of every instance, and makes stuck sagas easy to find. I would still keep each step's business logic in its own service.
Can the two styles be mixed?
Yes, and it is common. An orchestrator can run the core order flow, while other services such as analytics or notifications listen to its events in a choreographed way. The key is that one style owns the steps that need compensation.
What happens if a compensation itself fails?
It is retried, which is why it must be idempotent. If it keeps failing, for example because the payment provider rejects the refund, the saga moves to a state that needs manual attention, raises an alert, and someone resolves it. A saga should never silently stop.
8Conclusion
In this answer, we saw that a saga is a sequence of local transactions with a compensating action for each step. In choreography, services react to each other's events with no coordinator, which is light for a few steps but spreads the flow across codebases. In orchestration, a coordinator sends commands and stores the saga's state, which makes the flow explicit and easy to monitor at the cost of an extra component. In both, compensations are idempotent semantic undos such as refunds, and intermediate states are visible to others because sagas give no isolation.
Open with
A saga is a way to run a business process across services as a sequence of local transactions, where each step has a compensating action if a later step fails.
Then, if they want more
For the order flow, the steps are reserve stock, charge the card and schedule shipping, and if shipping fails we refund the card and then release the stock, in reverse order. In a choreographed saga there is no coordinator.
Each service listens for events and publishes its own: OrderPlaced leads inventory to reserve and publish StockReserved, payment reacts to that, and so on, and failures travel back as events too.
That is simple for a few steps and needs no extra component, but the flow only exists across all the subscriptions, so it is hard to see and hard to change. In an orchestrated saga, a coordinator such as an order saga service sends commands like ReserveStock and ChargeCard, waits for replies and stores the saga state after each step.
The flow is explicit, easy to test and monitor, and stuck orders are visible in one table. In both styles, compensations are semantic undos, a refund rather than a rollback, and they must be idempotent because commands can be retried. And sagas give no isolation, so other transactions see intermediate states, which I handle with pending statuses.
About this answer
- Last updated
- 12 November 2026
- Checked
- Its structure and format are checked automatically. Use it as a carefully prepared study note: where a detail matters, confirm it against the documentation below. What the checks cover
- Where the question comes from
- Written by Scrivio for practice. It is not taken from an interview.
- Official documentation
- Spring Cloud documentation, Resilience4j documentation
Report an issue with this answer
Copy the line below and send it to the author with what you found. It carries the address of this page.
Issue with "Explain the difference between a choreographed saga and an orchestrated saga for an...": https://scrivio-interview-library.netlify.app/spring-boot/distributed-data/4442ec7202/