Skip to main content

What is distributed cache stampede and prevention methods?

Senior NodeJS
Quick Answer Cache stampede (thundering herd): when a cache key expires and many requests simultaneously go to the database. Prevention: probabilistic early expiration (start refreshing before it expires), soft expiration (serve stale while refreshing in background), cache locking (only one request fetches; others wait for the lock), or pre-computation (scheduled refresh before expiry).

Answer

Prevent stampede using locks, request coalescing, stale responses, or probabilistic expirations.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice