top of page

Can Your Cache Recover Without Overloading the System Behind It?

Oct 24
3 min read

A shared dashboard normally feels fast because many visitors read the same cached summary. After a restart, the summary is missing. Every visitor now asks the underlying service to rebuild it at once. The cache was introduced to reduce load, but its empty state has become the busiest moment in the system.


This problem is often called a cache stampede or thundering herd. The important business question is whether an ordinary restart, expiration or cache outage can turn a small number of popular requests into an uncontrolled amount of rebuilding work.


Describe the miss path before tuning the hit rate


The Amazon Builders' Library discussion of caching describes the risk of many clients requesting the same uncached resource simultaneously. It discusses request coalescing, where requests share pending work, and recommends testing behavior when the cache is unavailable or disabled.


A high hit rate during normal operation does not describe that miss path. Ask the team to draw what happens after one popular value is absent: which service is called, how many requests can reach it and where waiting callers remain.


Keep this review distinct from deciding when a value becomes stale. Cache freshness is about which information is acceptable to serve. Stampede control is about how much work is created when information must be loaded again. A system needs an answer to both questions.


Example: a popular summary after restart


Suppose, illustratively, that 60 clients request one summary while its refresh takes two seconds. Without coordination, the implementation might start 60 equivalent refreshes. A coalescing design could share a single refresh within its coordination scope.


That scope matters. Sharing one refresh per process is different from sharing one across all processes. Ask for measured downstream requests during the test rather than accepting “we use a lock” as evidence that only one refresh occurs everywhere.


Specify what waiting users should experience


Choose an explicit waiting policy. Depending on the data and product contract, a caller might wait briefly for the refresh, receive a clearly identified older value, receive a limited response or be asked to retry later. None is universally correct.


For a public reference list, an older value may be acceptable for a defined period. For a decision that depends on current authorization or a rapidly changing business state, serving an old value can be inappropriate. Have the responsible owner define the acceptable data age and the consequences of a delayed answer.


Record the maximum waiting period and the result after that period. If waiting requests have no bound, coalescing may protect the downstream service while leaving users stuck indefinitely. The fallback must therefore address both dependency load and the customer experience.


Review the failed-refresh case


Deliberately make the refresh fail in a test environment. Observe whether waiting callers are released with a useful result, whether the next request starts another refresh and whether repeated failures cause a tight loop.


Also test the process holding the refresh responsibility disappearing. A coordination mechanism needs a recovery path. Otherwise, a feature intended to prevent duplicate work can leave everyone waiting for work that no longer exists.


Rehearse several kinds of cold start


Use synthetic traffic representative of one common request pattern. First remove one popular key. Then test a wider empty-cache condition. Finally, restore the cache after a temporary outage and observe whether recovery itself generates a burst.


Record four measurements: incoming request count, downstream refresh count, waiting time and the final response category. Add resource measurements where they help explain the result. Do not declare success solely because the cache eventually fills.


Keep the test bounded. Agree on an isolated environment, dependency limits and a stop condition before generating load. The purpose is to learn whether safeguards work, not to demonstrate how much pressure an unprepared shared service can withstand.


Turn the result into a recovery contract


Write a concise statement such as: “When the summary is absent, refresh work is bounded within the documented scope; callers either receive a result within the agreed window or a defined fallback.” Attach the test evidence and name the owner of the policy.


Review the contract when traffic patterns, cache topology or the cost of computing the value changes. A policy that works for one small worker may not have the same effect after the system expands to many instances.


For a project discussion, bring one popular cached object and its miss-path diagram. That is enough to uncover whether the cache is merely a performance improvement or an undeclared dependency on which the service now relies.


Continue with the related FutureOS guide for the related planning decision.


The published FutureOS introduction describes the project as being in prelaunch. Use this guide to prepare a concrete project discussion; it does not announce an available FutureOS feature.



Prepared with AI assistance. Primary sources checked on October 24, 2026. Examples and procedures are illustrative editorial guidance, not FutureOS product announcements or an independently reviewed assessment.

Comments


bottom of page