THIS EXPLANATION
THE ROOM
CDA·35 Computing, Data & AI 7 MIN · 8 STATIONS

Choreography versus orchestration

A Socratic walk-through of choreography versus orchestration — reasoned out one step at a time, not lectured.

abcdefgh
a

The question we started with

THE QUESTION #

Should each step know what comes next, or should one place know the whole plan?

An order has to be paid for, then stocked, then shipped, then confirmed. Four services, one sequence. Where should the knowledge of that sequence live?

There are only two honest answers. Either each service knows what it should trigger when it finishes — payment announces that it is done, and stock hears that and acts — or one component holds the whole plan and calls the four in turn. Both work. Both ship real systems. So the interesting question is not which is correct, but what each one is actually buying, and what it quietly gives up in exchange.

b

Reasoning it through

REASONING #

Begin with something easy to overlook: the sequence is a fact. Somebody or something has to hold it. It does not disappear when you distribute it; it only gets spread out. So the real choice is between keeping that fact in one place and scattering it across four.

Consider the scattered version — choreography. Payment finishes and publishes an event: payment taken. It does not know or care who listens. Stock happens to subscribe, reserves the item, and publishes stock reserved. Shipping subscribes to that. Nobody was called; everybody reacted.

What did that buy? Adding a fifth participant is now a matter of subscribing to an existing event and changing nothing that already runs. Loyalty points want to be awarded on payment? Subscribe. No existing service is edited, redeployed, or even told. That is a real and substantial property, and it is why choreography feels so good early on.

Now ask the awkward question: where is the process? Open any single service and you will find one step and a publish statement. The order of the four exists nowhere as an artefact — it is an emergent consequence of who happens to subscribe to what. To answer "what happens after payment?" you must inspect every subscriber list in the estate. To answer "why did order 4821 stop?" you must reconstruct its path from logs across four systems. Practitioners have a name for the failure mode this becomes at scale, and the honest version is not that choreography is wrong but that nobody owns the process, so nobody can see it, test it, or change it deliberately.

Turn to the other arrangement — orchestration. A single component holds the sequence explicitly: take payment, then reserve stock, then ship, then confirm. It calls each service and waits for the answer. The participants become simpler, because none of them knows what comes next; they take a request and return a result.

And now the process is a thing you can look at. It is a piece of code, or a definition, in one file. You can read it, diff it, version it, and ask an engine which step each in-flight order is on. When payment succeeds but shipping fails, the compensating action — refund the payment — has an obvious home, because one component knows that both happened and in what order. Under choreography, compensation is much harder: the service that must undo work is not the service that knows the overall attempt has failed, so the rollback has to be choreographed too, event by event.

What is the cost, then? Coupling of a particular kind. The orchestrator knows about all four participants. Every change to the process touches it. It is a place where a large amount of business logic accretes, and if it is written carelessly it becomes exactly the thing microservices were meant to escape — a central component that must be redeployed for any change anywhere.

Notice, though, that the two costs are not the same kind of cost. Orchestration concentrates coupling somewhere visible and nameable. Choreography does not remove the coupling; it makes it implicit. Payment and stock are still coupled — stock will break if payment's event shape changes — but the coupling now lives in a subscription no one is looking at. Is a dependency you can see worse than one you cannot?

One caution against false tidiness. Real systems are rarely purely one or the other, and the sensible boundary is about transactional meaning: steps that must succeed or be compensated together form a process and want an owner, whereas notifying interested parties wants events. One estate happily runs an orchestrated checkout that publishes an order completed event a dozen unrelated services choreograph around.

c

The analogy

THE ANALOGY #
THE FIGURE

Think of a dinner service in a restaurant kitchen. Choreography is the seasoned brigade where the grill cook slides a plated steak onto the pass and the garnish station, seeing it appear, acts — nobody announces anything, and a new station can be slotted in without retraining the others. Orchestration is the expediter calling the ticket: fire the steak, now the sides, now away. The expediter is the only one who knows the whole ticket, and the only one who can say where a delayed order has stalled.

WHERE IT BREAKS DOWN

a kitchen brigade shares a room and can see each other's stations, so its implicit coordination is under constant human observation, whereas distributed services cannot see one another at all — which is exactly why the invisibility of a choreographed process bites harder in software than the analogy suggests.

d

Clarifying the model

THE MODEL #

Three clarifications.

First, this is not centralised versus decentralised computing. An orchestrator is one logical holder of a process, not one machine and not one per estate; a large system typically has many orchestrated workflows, each owning its own sequence. Concentrating the plan is not concentrating the work.

Second, the common misconception is that choreography is more loosely coupled by nature. It is more loosely coupled at the call level — nobody addresses anybody — and equally coupled at the contract level, since every subscriber depends on an event's shape and meaning. What choreography really removes is the need for the publisher to know its consumers.

Third, the choice reverses more easily in one direction. Extracting a process from a choreographed estate means discovering it first, and that discovery is the hard part; loosening an orchestrated process by publishing events from it is easy, because the process was already written down.

e

A picture of it

THE PICTURE #
Choreography versus orchestration
Choreography versus orchestration compare the two halves as rival homes for the same fact. On the orchestration side, a solid arrow means a direct call, and every line of process knowledge sits inside one class, leaving the participant deliberately empty of it. On the choreography side, the dashed arrows are not calls at all -- no class names its successor -- so the same sequence exists only as the chain those dashes form, and no single box can answer where an order has got to. {"generator":"[email protected]","source":"../Socrates/.diagram-cache/_src/choreography-versus-orchestration.md","sourceIndex":1,"sourceLine":4,"sourceHash":"033729820ccd640974cd08e3f076245055fb7ec774b6ed101ae2ba9c2ca55b31","diagramType":"class","layoutVariant":"source","repairedDuplicateIds":[],"motion":"entrance-with-reduced-motion-fallback","presentation":"editorial","attempt":1,"viewBox":{"x":0,"y":0,"width":768,"height":810},"qa":{"passed":true,"findings":[]}} calls and awaits triggers by event triggers by event Orchestrator holds the whole sequence knows all four participants can report where an order is owns compensation on failure ChoreographedPayment knows one step publishes "payment taken" does not know who listens ChoreographedStock subscribes to "payment taken" publishes "stock reserved" cannot see the whole order ChoreographedShipping subscribes to "stock reserved" end of an unwritten sequence Participant takes a request returns a result holds no process knowledge

How to readcompare the two halves as rival homes for the same fact. On the orchestration side, a solid arrow means a direct call, and every line of process knowledge sits inside one class, leaving the participant deliberately empty of it. On the choreography side, the dashed arrows are not calls at all — no class names its successor — so the same sequence exists only as the chain those dashes form, and no single box can answer where an order has got to.

f

What became clearer

WHAT CLEARED #
WHAT CLEARED

The sequence is a fact that has to live somewhere, and the two styles differ in whether it is written down in one place or implied by a chain of subscriptions. Choreography buys the freedom to add a participant without touching anything, at the price of a process nobody can see or compensate as a unit. Orchestration buys visibility, explicit failure handling, and a single artefact to change, at the price of a component that knows everyone. The useful question when choosing is whether these steps must succeed or unwind together — if they must, the process deserves an owner.

g

Where to go next

ONWARD #
  • How compensation is arranged in a choreographed estate, and why sagas come up alongside this choice.
  • Whether an event schema is a looser contract than a function signature, or merely a less visible one.
  • What it takes to recover a lost process definition from an estate that has only subscriptions.
h

Key terms

TERMS #
TermWhat it means
Choreographycoordination by reaction, where each participant publishes what it did and others subscribe, with no component holding the whole sequence.
Orchestrationcoordination by direction, where one component holds the sequence and invokes each participant in turn.
Compensationan action that undoes an already-completed step when a later step fails, since a distributed process cannot simply roll back.
Sagaa long-running process of local steps, each with a compensating action, arranged by either style.

Every term the collection defines is gathered in the glossary.

Nearby on the shelf

4