Blog
Event-Driven Order State in High-Volume Logistics
· 7 min read
Two thousand active drivers do not fail gracefully. They fail concurrently — duplicate taps, stale GPS fixes, offline queues replaying in random order.
The product promise was simple: customers see trustworthy ETAs. The system requirement was harder: every state transition must be explainable after the fact.
Sagas without the ceremony
We did not adopt a heavyweight saga framework. Each order lived in a finite state machine. SQS carried domain events; Lambda workers were idempotent on orderId + transition + version.
When a handler failed, the message returned to the queue with backoff. Ops could replay from PostgreSQL event rows without reconstructing tribal knowledge.
What moved the ETA metric
Better geolocation batching helped. Honest uncertainty in the model helped more. We started publishing confidence intervals internally before smoothing them for customers.
34% ETA error reduction was as much about measurement honesty as about algorithms.