All posts
Engineering
· 9 min read
Ordered delivery without a global lock
Per-endpoint ordering sounds like a queue with one consumer. Here is how we keep order and still fan out across regions.
MA
Maya Alvarez
Staff Engineer, Delivery

Ordered delivery is the feature customers ask for and infrastructure teams dread. The naive version is a single consumer per endpoint, which caps throughput at one in-flight request and makes every slow endpoint a head-of-line blocker.
Ordering is per key, not per endpoint
Most workloads only need order within a key: a customer id, an invoice, a document. We partition each endpoint’s stream by the ordering key you choose, so thousands of keys can be in flight at once while any single key stays strictly sequential.
Leases instead of locks
A partition is owned by one worker under a short lease. If the worker dies the lease expires and another region picks up the partition from the last acknowledged attempt. No coordinator, no global lock, and a failover that takes seconds rather than a deploy.
The result is ordered delivery that scales horizontally and degrades gracefully. The one trade-off is that a slow endpoint slows its own keys, never its neighbours.
Ship your first webhook in five minutes.
Buy this template
$49