Request coalescing
Definition
Request coalescing ensures that while a fetch for a given key is in flight, further requests for the same key wait for that fetch and reuse its result instead of issuing their own.
In practice
It is the main defence against cache stampedes: when a hot key expires, thousands of concurrent misses become a single database query. Go's singleflight package, loading caches, CDN collapsed forwarding and origin shields all implement it at different layers.
In-process coalescing only merges requests within one process, so 50 application instances still send up to 50 queries; a distributed lock or a shared cache tier is needed to go further. Waiters all fail together if the single fetch fails or hangs, so give it a timeout, and do not coalesce requests whose results differ per user.
Example
When feed:home expires, 3,000 concurrent requests on one server call group.Do("feed:home", load); one query runs and all 3,000 receive its result about 40 ms later.