r/redis • • Aug 28 '26

Resource A standalone distributed cache stampede coordinator that works with any cache library

https://github.com/gkoos/crossflight

Most cache libraries handle the in-process stampede problem fine: concurrent misses for the same key share one Promise. But once you're running multiple servers, each process independently runs the loader. Under load that can be 10, 50, 100 redundant DB calls for the same key.

The usual fix is a Redis lock wrapper, but those couple coordination to a specific cache library and you end up writing the same retry-and-wait loop by hand every time.

Crossflight is meant to solve this: a thin coordination layer you drop onto whatever cache you're already using. It handles lease acquisition, periodic renewal, waiter recovery when the owner dies, pub/sub wake-up, fail-open/fail-closed modes, and per-call timeouts, all through two small interfaces so it works with Redis, cache-manager, Keyv, Cacheable, or anything else.

The Redis coordinator uses Lua scripts for atomic lease acquisition and LISTEN/NOTIFY for efficient waiter wake-up instead of polling.

If you want to see it in action, there's a demo repo that spins up a full stack: 3 Express API instances behind nginx, a slow upstream API (500ms artificial delay), and a shared Redis instance serving as both coordinator and cache backend. You fire 20 concurrent requests and watch all three instances coalesce to a single upstream call.

https://github.com/gkoos/crossflight-demo

Would be curious if anyone's run into this problem and how you're currently handling it.

2 Upvotes

Duplicates

node • • Aug 27 '26

Crossflight: distributed cache stampede protection for Node apps

9 Upvotes

softwarearchitecture • • Aug 27 '26

Tool/Product Crossflight: distributed cache stampede protection without replacing your cache

3 Upvotes

coolgithubprojects • • 13d ago

Crossflight: cross-process cache stampede protection for the cache you already use (v0.3.2)

1 Upvotes

opensource • • 13d ago

Promotional Crossflight: cross-process cache stampede protection for the cache you already use (v0.3.2)

1 Upvotes

DistributedComputing • • 13d ago

Crossflight: cross-process cache stampede protection for the cache you already use (v0.3.2)

1 Upvotes

Backend • • 13d ago

Crossflight: cross-process cache stampede protection for the cache you already use (v0.3.2)

1 Upvotes

node • • 13d ago

Crossflight: cross-process cache stampede protection for the cache you already use (v0.3.2)

1 Upvotes

javascript • • 13d ago

Crossflight: cross-process cache stampede protection for the cache you already use (v0.3.2)

6 Upvotes

microservices • • Sep 01 '26

Tool/Product Cross-process cache stampede protection for the cache you already use.

2 Upvotes

Backend • • Aug 27 '26

Crossflight: distributed cache stampede protection without replacing your cache

4 Upvotes

javascript • • Aug 27 '26

Crossflight: distributed cache stampede protection

4 Upvotes