Saga Pattern for Order Fulfillment
Choreography vs orchestration — why we picked orchestrated sagas with compensating transactions.
Distributed transactions with 2PC was not an option across payment, inventory, and shipping services.
Flow
Orchestration vs Choreography
| Approach | Pros | Cons |
|---|---|---|
| Choreography (events only) | Loose coupling | Hard to trace, debug |
| Orchestration (central coordinator) | Clear state machine | Single point to maintain |
We chose orchestration with state persisted in PostgreSQL. Each step idempotent. Compensating actions explicit in the saga definition — no “hope the event handler reverses it.”
Saga timeout: 15 minutes. Stuck sagas alert to on-call.
saga , distributed-transactions , orders · .NET , PostgreSQL , Redis