grafclouds.com / documents / training / devops-challenges / cache-stampede-after-deploy

Every Deploy Hammers the Database for 10 Minutes. Bigger DB?

Intermediate ~12 min read
DatabasesObservability

Scenario

Your e-commerce API deploys several times a day, and every deploy follows the same painful script: the deploy pipeline wipes the entire Redis cache, and for the next ten minutes the primary Postgres instance pins at 90–95% CPU while p99 latency goes from a comfortable ~80ms to multiple seconds, with some requests timing out entirely. Outside those windows the database idles at 25–30% CPU with a cache hit rate around 97%. The expensive product and pricing queries that the cache normally absorbs all land on the database at once, many of them duplicates of each other. There is no request coalescing, and every key carries the same flat TTL.

The Quick Fix on the Table

A teammate wants to double the database instance size. The reasoning: it is only money, the spike is only ten minutes, and a machine twice the size will simply shrug it off. No code changes, no risk, problem gone.

Interview · Round 1

The quick fix is on the table and the room is waiting for your call. Would you sign off on it? Take a position and justify it — out loud or on paper — before revealing the analysis.