Choreography vs Orchestration

Choreography vs Orchestration

When a workflow spans multiple components and EDA is the communication mechanism, two patterns for coordinating the steps: choreography (each component reacts to events) and orchestration (a central coordinator drives the steps).

Choreography

Each component subscribes to relevant events and emits its own. The workflow is emergent: no one component owns it.

Order:    emits OrderPlaced
                       v
Stock:    subscribes to OrderPlaced
          reserves stock
          emits StockReserved (or StockReservationFailed)
                       v
Payment:  subscribes to StockReserved
          charges payment
          emits PaymentCaptured (or PaymentFailed)
                       v
Shipping: subscribes to PaymentCaptured
          creates shipment
          emits ShipmentCreated

No one component knows the whole flow. Each only knows its own input and output events.

Properties:

Orchestration

A central coordinator (the orchestrator, or process manager, or saga coordinator) calls each step and reacts to results.

class PlaceOrderSaga:
    def __init__(self, stock, payment, shipping):
        self._stock = stock
        self._payment = payment
        self._shipping = shipping

    async def execute(self, order_id: UUID):
        try:
            await self._stock.reserve(order_id)
            await self._payment.capture(order_id)
            await self._shipping.create(order_id)
        except PaymentFailed:
            await self._stock.release(order_id)
            raise
        except ShippingFailed:
            await self._payment.refund(order_id)
            await self._stock.release(order_id)
            raise

The orchestrator owns the workflow; participants own their step.

Properties:

Side-by-side

Choreography Orchestration
Coupling Low (events only) Medium (orchestrator knows participants)
Flow visibility Hidden (across subscribers) Explicit (in orchestrator)
Adding a participant New subscriber Modify orchestrator
Compensation Distributed (each step compensates) Centralised (orchestrator triggers)
Debuggability Hard Easy
Failure isolation Each step independent Orchestrator is a failure point
Best for 2-3 step workflows; truly independent reactions 4+ step workflows; complex compensation

When to choose choreography

When to choose orchestration

Anti-patterns

The middle ground

Most systems use choreography for independent reactions (notifications, logging, projections) and orchestration for explicit workflows (place-order, refund, onboarding). Not a competition — choose per workflow.

A practical saga implementation

When orchestration is needed, persist the saga state so it survives restarts:

saga table:
  saga_id | order_id | step | status | payload | updated_at

The orchestrator is a state machine that:

  1. Reads sagas in "pending" state.
  2. For each, runs the next step.
  3. Updates state. Loop.

If the process crashes mid-saga, on restart it picks up where it left off. Compensation runs from the persisted state, not from in-memory variables.