What is the Orchestration pattern, and how does it differ from the Choreography pattern?

Orchestration and choreography are two approaches to coordinating a multi-step business process across microservices: orchestration uses a central controller, while choreography relies on services reacting to each other's events.

Key Points: • In orchestration, a central orchestrator explicitly calls each service in sequence and tracks the overall workflow state, similar to a conductor directing musicians. • In choreography, each service publishes events when it completes work, and other services subscribe and react independently with no central controller. • Orchestration gives clearer visibility and easier debugging of the overall process, since the workflow logic lives in one place. • Choreography is more loosely coupled and scales better organizationally since services don't depend on a central coordinator, but the overall flow can become hard to trace as more services join. • Orchestration is often implemented with tools like Camunda or a dedicated orchestrator service; choreography relies on an event broker like Kafka.

Example: For an order fulfillment process, an orchestrator-based Saga would have an Order Orchestrator service directly call Inventory, then Payment, then Shipping in sequence, whereas a choreography-based Saga would have each service listen for the previous service's event and publish its own once done.

Interview Tip: A concise interview answer is:

"Orchestration uses a central coordinator that directs each service step by step, giving clear control and easier debugging but creating a central dependency. Choreography has services react to each other's events with no central coordinator, which is more decoupled and scalable but harder to trace end-to-end as the number of services grows."