Choreography vs Orchestration

A business process like "place an order" spans several services: reserve inventory, charge payment, arrange shipping, send a confirmation. Once these live in separate microservices with their own databases, someone has to coordinate the steps, handle failures, and undo partial work. There are two fundamental styles:

Both implement long-running, distributed processes such as sagas. The choice shapes coupling, visibility, failure handling, and how easy it is to change the process later.

TL;DR

Quick Example

Choreography: each service reacts to the previous event.

Orchestration: a durable workflow drives the steps (Temporal-style TypeScript).

The workflow engine persists progress, so a crash mid-process resumes exactly where it stopped.

Core Concepts

Choreography

Services subscribe to events they care about and publish events describing their own outcomes. No service knows the whole process.

Strengths

Weaknesses

Orchestration

A coordinator (a saga orchestrator, process manager, or workflow) owns the process state and sends commands to participants, which reply with results.

Strengths

Weaknesses

Comparison

Sagas Both Ways

A saga is a sequence of local transactions with compensating actions for rollback. It can be choreographed (each service listens for failure events and compensates) or orchestrated (the orchestrator calls compensations in reverse order). Orchestrated sagas are easier to reason about as the number of steps grows. See saga pattern.

Workflow Engines and Durable Execution

Hand-building a reliable orchestrator means persisting state, handling retries, timers, and crashes, and versioning in-flight processes. Durable execution engines do this for you:

See durable execution.

Reliability Essentials (Both Styles)

Choosing and Combining

Best Practices

Keep Business Rules in Domain Services

Orchestrators should coordinate the sequence, timeouts, and compensations, not implement pricing rules or eligibility logic that belongs in domain services.

Make the Process Visible

For choreography, build process dashboards from correlated events, or add a lightweight process tracker. For orchestration, expose workflow state and history to support teams.

Design Compensations Up Front

For each step, define how to undo or mitigate it, and what happens if the compensation fails (retry, alert, manual queue).

Version Long-Running Processes

In-flight workflows may run for days. Workflow engines provide versioning APIs, and choreographed flows need backward-compatible events. See event schema evolution.

Common Mistakes

Event Chains Nobody Understands

A 12-step process implemented as choreography becomes a distributed puzzle. When flows grow complex, introduce an orchestrator.

Orchestrator as a Distributed Monolith

Centralizing all logic in a giant orchestrator that micro-manages every service recreates a monolith with network calls. Keep orchestration thin.

No Timeout Handling

Waiting forever for an event that never arrives leaves processes stuck silently. Every step needs a deadline and a fallback.

FAQ

What is the difference between choreography and orchestration?

In choreography, services coordinate by reacting to each other's events, with no central controller. In orchestration, a central coordinator explicitly directs each step by sending commands and tracking the process state. Choreography maximizes decoupling, while orchestration maximizes visibility and control.

Which is better for sagas?

For simple sagas with a few steps, choreography works well. For sagas with many steps, branching, compensations, or timeouts, orchestration is usually easier to build, understand, and operate, especially with a workflow engine.

Is an orchestrator a single point of failure?

It can be, if hand-built naively. Workflow engines and managed services are designed to be highly available and durable: they persist state, so workflows resume after crashes. Treat the orchestrator as critical infrastructure.

Can I use both choreography and orchestration?

Yes, and most mature systems do: event-based choreography between bounded contexts for loose coupling, and orchestration inside a context for complex processes, with orchestrated workflows publishing events that other contexts react to.

Related Topics

References