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

ApproachProsCons
Choreography (events only)Loose couplingHard to trace, debug
Orchestration (central coordinator)Clear state machineSingle 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

More in Distributed Systems