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

← All Databases & Caching questions