1.Choreography: services react to events, no central coordinator
In a choreographed saga, there is no single component directing the workflow — each service completes its own local transaction and publishes a domain event describing what happened, and other services subscribe to those events and react by running their own local transactions in turn, publishing their own events afterward. The overall workflow emerges from this chain of event reactions rather than being explicitly controlled by any one place; no service needs to know the full sequence of steps, only which events it should react to and which event it should publish when it is done.
Key features
- Each service completes its own local transaction, then publishes a domain event (e.g. "OrderPlaced," "PaymentCharged") describing what just happened
- Other services subscribe to the events relevant to them and react by running their own local transaction, publishing their own resulting event when done — no service calls another directly to trigger the next step
- No single service holds the full sequence of the workflow — each one only knows its own trigger events and its own resulting event, which keeps individual services simpler and more decoupled from the overall flow
- The trade-off: with the workflow logic spread across every participating service instead of centralized in one place, understanding or debugging the full end-to-end flow requires tracing events across multiple services' logs rather than reading one orchestrator's code
- Choreography fits naturally on top of an existing event-driven architecture (a message broker or event log already in use), since it is fundamentally just services reacting to each other's events — the same infrastructure already covered in this project's messaging sections
What each service knows and does in a choreographed saga
- Order service — creates the order
- leads to Payments service (OrderPlaced)
- Payments service — charges the card
- leads to Inventory service (PaymentCharged)
- Inventory service — reserves the item
- leads to Shipping service (InventoryReserved)
- Shipping service — schedules shipment
Command
Order service: commits, publishes OrderPlaced
Payments service: subscribes OrderPlaced
commits, publishes PaymentCharged
Inventory service: subscribes PaymentCharged
commits, publishes InventoryReserved
Shipping service: subscribes InventoryReserved
commits, publishes ShipmentScheduledChoreography: each service commits its own local transaction and publishes an event; other services react by subscribing to relevant events and running their own local transactions in turn. No service holds the full workflow — it emerges from the chain of reactions, which keeps individual services decoupled but makes the end-to-end flow harder to see in one place.