← Concepts

阅读中文版本

Choreography Versus Orchestration

Choreography lets services react to each other events independently; orchestration centralizes sequencing in a coordinator, trading implicit flow for explicit control.

architecture

Definition

Choreography is event-driven cooperation: each service subscribes to events it cares about and performs its part, with no central director. Orchestration assigns a conductor — a saga or process manager — that commands participants explicitly. Choreography scales organizationally without a bottleneck but scatters process visibility; orchestration offers readable, testable flow logic but adds a coordination dependency.

Context and scope

Decided per workflow in event-driven systems: order fulfillment, provisioning pipelines, payment retries. Most mature systems mix both per flow criticality.

Common misconceptions

  • Choreography has no coordination at all — sequencing still exists; it is encoded in subscription topology, just invisible to any single reader
  • Orchestration reintroduces the monolith — the orchestrator coordinates, it does not own business data or logic; participants stay autonomous
  • Pick one style for the whole system — per-workflow choice fits: critical multi-party flows gain from explicit orchestration, simple chains stay choreographed

Anti-patterns

  • Building a critical twenty-step workflow as pure choreography and debugging it through twelve dashboards
  • Orchestrating trivial two-service interactions and paying coordinator deployment for every change
  • Assuming event order from a broker without sequencing guarantees and corrupting choreographed state

Related concepts

Authoritative source

https://microservices.io/patterns/sagas.html

What it is

Two ways to make many services do one job. Choreography: each reacts to events, nobody directs — the flow is an emergent property of subscriptions. Orchestration: one component holds the recipe and commands the others — the flow is a readable artifact.

How it works

Choreographed flows publish domain events and subscribe across services; adding a step means adding a subscriber, and failures surface as stuck flows needing tracing to diagnose. Orchestrated flows route events and commands through the coordinator, whose state machine encodes steps, retries, and compensations, giving one place to monitor and test the flow.

When to choose

Choreography for simple, appendable steps with independent consumers; orchestration for flows with business-visible sequencing, compensation, timeouts, or regulatory audit. Transition cost grows with participants, so decide early and revisit per flow.

Pitfalls

Choreography hides cycles: two services reacting to each other create feedback loops no single diagram shows. Orchestrators accumulate business logic by gravity — review boundaries like any monolith boundary. Event ordering guarantees differ per broker: choreographed state machines relying on order need per-entity sequencing or risk corruption.