Request Coalescing
Also known as:
Request Collapsing
Singleflight
In-flight Deduplication
Definition
Request coalescing collapses many identical in-flight requests into a single backend call, then shares that one result with all the waiters. When several requests ask for the same thing at the same moment, only the first does the real work while the rest wait for its answer. It is a core defence against the thundering herd problem, keeping a hot cache miss or popular key from turning into a flood of duplicate database queries.
Popular reads
View All
Payment System Design: Ledger, Idempotency, and Settlement
Jul 18, 2026
The Complete HTMX Guide: From Zero to Production
Dec 22, 2025
Cursor Skills: How to Create and Use Agent Skills
Jun 23, 2026
Complete Guide to Graph Data Structure: BFS, DFS, Adjacency List vs Matrix
Jan 20, 2026
Transactional Outbox Pattern: Never Lose an Event Again
Apr 07, 2026
Flash Sale System Design: Architecture, Scale, and Oversell
May 16, 2026
Key Takeaways
- Duplicate concurrent requests for the same key are merged into one backend call whose result is shared.
- It directly tames the thundering herd that follows a hot cache key expiring for everyone at once.
- Only the first caller does the work; the rest block briefly and receive the same computed value.
- It differs from caching: coalescing dedupes work that is happening right now, while caching reuses a value already computed.
How It Works
- A request arrives for a key and the system checks whether a call for that key is already in flight.
- If none exists, it starts the work and registers the in-flight call.
- Any further requests for the same key attach to the existing call instead of starting their own.
- When the call finishes, its result is handed to every waiter and the in-flight entry is cleared.
Where It Is Used
- Go’s singleflight package coalesces duplicate concurrent calls for the same key.
- CDNs use request collapsing so one origin fetch serves many waiting clients during a cache miss.
- Cache layers pair coalescing with TTL jitter to smooth load after popular keys expire.