Interview › Databases & Caching
How do you handle cache warming after a restart or failover?
Databases & Caching · Advanced level
Answer
Cache warming preloads hot keys after restart, failover, or new cluster creation so user traffic does not create a cold-cache miss storm. It must be throttled and monitored to avoid overloading the database.
Technical explanation
Cold caches can shift traffic to RDS and create a secondary outage.
Warm only known hot keys and throttle the job.
Stop warming if source DB or application SLOs degrade.
Hands-on example
Warmup job:
for key in $(cat top_keys.txt); do curl -s "https://product-service/internal/cache-warm?key=$key" >/dev/null; sleep 0.05; done
Stop if RDS CPU > 70% or app p95 exceeds SLO.Preparing for an interview?
Check how well your resume matches the role with our free resume checker— match score, ATS check, and the skills you're missing.
More Databases & Caching interview questions
- How do you decide what to cache and what not to cache?
- What is the blast radius of a cache outage, and how do you make the app degrade gracefully?
- How do you test a Redis or database failover without impacting users?
- How would you use Redis for distributed locking, and what are the caveats?
- How would you use Redis for rate limiting?
- What is the difference between Redis as a cache and Redis as a primary datastore?
- Why are some Redis commands (KEYS, FLUSHALL) dangerous in production?
- What is a cache hit ratio, and how do you improve it?