Service Choreography
A decentralized coordination model for distributed services where individual services control interaction logic locally and interactions occur without a central controller.
Classification
- ComplexityHigh
- Impact areaTechnical
- Decision typeArchitectural
- Organizational maturityIntermediate
Technical context
Principles & goals
Use cases & scenarios
Compromises
- Inconsistencies with insufficient compensation strategy
- Hidden dependencies and implicit sequence prerequisites
- Excessive observability effort without proper tooling
- Write idempotent event handlers for safe retries
- Use clear, versioned event schemas and a registry
- Implement distributed tracing for traceability
I/O & resources
- Explicit event or API contracts
- Message broker or event infrastructure
- Monitoring, tracing and versioning tools
- Decoupled, autonomous services with defined interaction contracts
- Events as integration artifacts
- Distributed error and compensation paths
Description
Service choreography is a decentralized model for coordinating distributed services, where each component enforces interaction rules locally. Unlike orchestration, there is no central controller and coordination and error handling responsibilities are distributed. It is particularly suited to loosely coupled, domain-specific microservice architectures.
✔Benefits
- Reduced central dependency increases resilience of individual components
- Improved team autonomy through local decision authority
- Scalability of individual reaction paths without a central bottleneck
✖Limitations
- Increased complexity in error handling and compensation
- Harder end-to-end testing due to distributed flows
- Requires strict event and contract discipline between teams
Trade-offs
Metrics
- Throughput per event topic
Measures the number of events processed per time interval for a topic.
- End-to-end latency
Time from emitting an event to final processing and acknowledgement.
- Failure and compensation rate
Share of transactions requiring compensation or manual intervention.
Examples & implementations
Event-driven order pipeline
An online shop distributes order, payment and shipping logic to autonomous services that are choreographed via events.
Microservice saga as choreography
A saga implementation distributes compensation steps across involved services that react to each other's events.
IoT integration with decentralized control
Edge components and cloud services coordinate actions via events without a central orchestrator.
Implementation steps
Analyze domain boundaries and identify relevant events.
Define event and API contracts and versioning rules.
Introduce event infrastructure, observability and compensation conventions.
⚠️ Technical debt & bottlenecks
Technical debt
- Unstructured events without registry increase integration costs
- Missing trace propagation hinders debugging
- Ad-hoc compatibility fixes instead of proper versioning
Known bottlenecks
Misuse examples
- Using choreography for highly transactional workloads without compensation
- Lack of versioning leads to widespread incompatibilities
- Insufficient monitoring so errors are not detectable
Typical traps
- Underestimating the observability effort
- Implicit sequence assumptions between independent services
- Introducing compensation logic too late
Required skills
Architectural drivers
Constraints
- • Requirement for compatible event formats
- • Network latency and asynchronous delays
- • Regulatory requirements for transaction safety