singleflight

A technique that merges many simultaneous identical requests into one, so only one does the work and they all share its result.

In more detail

When a hot cache key expires, singleflight lets a single database query refill it instead of thousands. The name comes from the Go library that popularised it.

Related terms

Taught in

References