@hello.interview: Your cache just expired. 10,000 requests hit your database at once. That's a cache stampede, and most engineers only know one way to fix it. Cache locking. One request grabs a mutex and rebuilds the cache, everyone else waits in line. It works, but if that rebuild fails or takes too long, you've got thousands of requests timing out. Fragile. Request coalescing. Instead of queuing requests, you collapse them. Every duplicate in-flight request gets the same result from a single upstream call. Cloudflare does this at the CDN layer. Your backend goes from getting hammered by 10,000 requests to getting exactly one per app server. Probabilistic early refresh. Before the TTL expires, each request has a small random chance of triggering a background refresh. At minute 50 of a 60-minute TTL, maybe 1% of requests refresh it. At minute 59, maybe 20%. Refreshes spread out naturally. No thundering herd. Background refresh. A worker proactively recomputes hot keys before they expire. Best for predictable traffic, like a Ticketmaster event page where you know exactly what's going to get hammered. Start with request coalescing. It's the easiest win and works at the CDN or app layer. Add probabilistic early refresh for unpredictable spikes. Use background refresh only when you can predict what's hot. Skip mutex locking unless you're already on Redis and need a quick patch. Full caching breakdown linked in bio.

Hello Interview
Hello Interview
Open In TikTok:
Region: US
Wednesday 06 May 2026 16:08:49 GMT
22398
1306
11
84

Music

Download

Comments

aaron.cowie6
Aaron Cowie :
yep. I do the last one. I call it a Hot Cache. as the cache expires, I keep the value but dona background refresh. so always have a value in the cache
2026-05-06 22:29:16
4
varunjsr78
Var :
cache priority is also another way to solve for this problem, where every priority has a different expiry times depending on data refresh rates. For example, a cache with P1 priority expires every 1 hour (even shorter if needed) while P5 expires every 48-72 hours.
2026-06-20 16:28:50
0
spot.mon
spot.mon :
This only works for public data, there are personal or private data which I don’t think caching is a great idea …
2026-05-21 18:54:47
0
barkenflopsmcgee
Barkenflops Mcgee :
How would request coalescing actually be implemented ?
2026-06-14 00:36:47
0
uhohbanka
WTFBobby :
You guys are the best resources out there. You and Evan convinced me to get the premium. Kudos to both of you
2026-05-06 16:21:49
0
tyranny706
Champ :
I always use jitter, simple 👍️
2026-05-08 04:02:27
1
tonkatwuck8
Tonkatwuck :
stale while revalidate
2026-05-27 19:07:10
0
meonlife2
MeOnLife :
😳😳😳
2026-05-27 22:18:01
0
To see more videos from user @hello.interview, please go to the Tikwm homepage.

Other Videos


About