.NET Architecture & System Design Interview Question #95

What is the difference between Saga orchestration and choreography?

Transactions, CQRS, Event Sourcing & Distributed Consistency Mid-Level Intermediate

Quick Interview Answer

In orchestration, a coordinator explicitly tells participants which action to perform and tracks the workflow. In choreography, services react to events and publish subsequent events without one central workflow controller.

Detailed Explanation

In orchestration, a coordinator explicitly tells participants which action to perform and tracks the workflow. In choreography, services react to events and publish subsequent events without one central workflow controller.

Orchestration makes complex workflows easier to visualize and govern. Choreography can reduce central coordination but may become difficult to trace when many services react to one another.

Code Example

Orchestration:
Saga -> Inventory -> Payment -> Shipping

Choreography:
OrderPlaced
 -> InventoryReserved
 -> PaymentCompleted
 -> ShipmentRequested