Choreography and orchestration are the two coordination styles for implementing the Saga pattern, differing in whether control is decentralized through events or centralized through a coordinator.
Key Points: • In choreography, each service listens for events from other services and decides independently how to react, with no central component directing the flow. • In orchestration, a central saga orchestrator explicitly commands each service what to do and in what order, and waits for each response before proceeding. • Choreography scales well and keeps services loosely coupled, but the overall business process becomes harder to trace since it's spread across many services. • Orchestration makes the workflow easy to see and modify in one place, but the orchestrator becomes a critical component and adds a degree of central coupling. • Simpler sagas with few steps often favor choreography, while complex, long-running workflows often favor orchestration for the sake of visibility and control.
Example: For a three-step order saga, choreography would have Order publish OrderPlaced, Payment react by charging and publishing PaymentCompleted, and Inventory react to that; orchestration would instead have a central OrderSagaOrchestrator explicitly call Payment, wait for success, then call Inventory.
Interview Tip: A concise interview answer is:
"Choreography coordinates a saga through each service reacting to events independently, which is loosely coupled but harder to trace end to end. Orchestration uses a central coordinator that explicitly drives each step, which is easier to follow and control but introduces a critical central component. I'd pick choreography for simple flows and orchestration once the workflow gets complex."