choreography vs orchestration pattern
Two ways to coordinate a multi-service workflow. Orchestration: a central coordinator (a saga orchestrator, a workflow service) tells each service what to do, in order. Choreography: services emit events; other services subscribe and react; no central brain. Orchestration is easier to reason about and trace; choreography is more decoupled but the workflow becomes implicit and harder to follow.
Two ways to coordinate a multi-service workflow. Orchestration: a central coordinator (a saga orchestrator, a workflow service) tells each service what to do, in order. Choreography: services emit events; other services subscribe and react; no central brain. Orchestration is easier to reason about and trace; choreography is more decoupled but the workflow becomes implicit and harder to follow.
symptoms
- hard to trace what happens after event X
- changing one service breaks an unrelated workflow
- no clear owner for the end-to-end flow
causes
- choreography taken too far without docs
- orchestration becomes a god-service
fixes
- orchestration when workflow is the product
- choreography when services are independent and you want loose coupling
- document the workflow either way
- distributed tracing makes both legible
you might say
- orchestrate it
- event choreography
- who knows where the workflow lives?