Request Coalescing: Preventing the Thundering Herd in Node.js

When a cached value expires under heavy traffic, every request that arrives in the next few milliseconds misses the cache simultaneously. Each one fires the same database query, the same external API call, the same expensive computation — all producing the same result. This is the thundering herd problem, and it's deceptively easy to miss until traffic is high enough that it matters.

The fix isn't a distributed lock or a sleep-and-retry loop. It's inflight request coalescing: deduplicate concurrent in-flight requests for the same resource so only one upstream call ever runs, and every waiting caller shares the resolved value.