API / Microservices Design Patterns Interview Questions
What is the difference between Choreography-based and Orchestration-based Sagas?
Both styles implement the Saga pattern (Q10) but differ fundamentally in how the steps are coordinated. In Choreography, there is no central authority: each service listens for domain events published by the preceding step and reacts autonomously, emitting its own event to trigger the next participant. In Orchestration, a dedicated Saga orchestrator sends explicit commands to each participant and receives success/failure responses, driving the workflow from a single place.
| Aspect | Choreography | Orchestration |
|---|---|---|
| Coordination | Implicit via domain events on a message broker | Explicit commands from a central orchestrator |
| Coupling | Services are coupled to event topics, not to each other | Orchestrator is coupled to each participant service |
| Visibility | Flow is distributed across services; hard to visualise end-to-end | Entire saga flow is explicit in the orchestrator's state machine |
| Debugging | Requires correlating events across multiple logs and services | Orchestrator state shows exact step and failure point |
| Scalability | Good — no central bottleneck | Orchestrator can become a bottleneck at very high throughput |
| Best for | Simple 2–3 step sagas; teams that already use event-driven patterns | Complex multi-step sagas with many compensations and error paths |
Choreography example — OrderService emits OrderCreated; InventoryService listens and emits StockReserved; PaymentService listens and emits PaymentProcessed; OrderService listens and marks the order confirmed. No single component knows the full flow.
Orchestration example (using AWS Step Functions or Temporal):
OrderSagaOrchestrator:
1. send ReserveStockCommand → InventoryService
2. on StockReserved: send ChargePaymentCommand → PaymentService
3. on PaymentProcessed: send ConfirmOrderCommand → OrderService
4. on PaymentFailed: send ReleaseStockCommand → InventoryService (compensate)
Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!
Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.
Invest now!!! Get Free equity stock (US, UK only)!
Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.
The Robinhood app makes it easy to trade stocks, crypto and more.
Webull! Receive free stock by signing up using the link: Webull signup.
More Related questions...
