single flight

Letting only one request fetch a missing value while other requests for the same key wait for its result.

In more detail

It turns a herd of misses on one hot key into a single origin call. It is usually combined with serving the stale value while the one worker refreshes.

Example

In the simulation, 30 origin calls without single flight become 4 with it.

Related terms

Taught in

References