SOLID & Design Patterns Interview Question #119

What is the difference between Saga orchestration and choreography?

Architectural Patterns, Application Boundaries & Distributed Design Patterns Senior Advanced

Quick Interview Answer

In orchestration, a central saga coordinator tells participants which step to execute and decides what happens next. In choreography, participants react to events and publish new events without one central workflow controller.

Detailed Explanation

In orchestration, a central saga coordinator tells participants which step to execute and decides what happens next. In choreography, participants react to events and publish new events without one central workflow controller.

Orchestration makes the overall flow easier to see but centralizes coordination. Choreography can reduce central coupling but may make a large workflow difficult to trace when many services react to many events.

Code Example

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

Choreography:
OrderPlaced -> InventoryReserved
             -> PaymentCompleted
             -> ShipmentCreated