Skip to content
← All issues

Readyset Weekly: Issue 60

Why Cache Invalidation Breaks in Production

Serving a cached query result is usually the easy part. You run the expensive join once, store the result, and serve it fast for subsequent requests. The hard part shows up later, when the underlying data changes and the cache keeps serving the old answer. The system isn't down and it isn't slow, it's just wrong, and it looks perfectly healthy while it happens.

This is the invalidation problem, the moment you add a cache, you have two copies of the truth, the database and the cache, and keeping them in sync becomes your job. Most caching setups hand that job to application code. Someone has to decide what a cached result depends on, when it expires, and what changes should invalidate it. Every one of those decisions is another opportunity for stale data to creep in.

Here's where manual invalidation tends to break down, and what handling it well looks like:

  • TTLs force a guess between stale and wasteful. Set the expiry too long and users see old data, too short and you're recomputing the query so often the cache barely helps. What good looks like: freshness driven by underlying data changes, not a manually tuned timer.

  • Cached results depend on changing assumptions. A key encodes assumptions about what a cached result depends on. Change a query or a schema, and invalidation rules written months ago quietly stop reflecting the query's actual dependencies. What good looks like: the cache understanding which data a result depends on, so the right entries are updated or invalidated.

  • Invalidation logic is spread across the codebase. The write that changes a record and the cache entry that depends on it often live in different files, owned by different people. Miss one path and that entry goes stale until something forces it out. What good looks like: invalidation tied to the database's own record of what changed, not to every application path that can modify data.

  • Stale data fails silently. A cache serving a wrong answer throws no error and triggers no alert. You find out when a customer sees yesterday's price or a deleted record that won't go away.

  • What good looks like: a cache that stays synchronized with underlying data, because it's watching the same change stream the database writes.

There's a different way to draw the line. Instead of asking application code to track what changed, a cache can watch the database's replication stream and update or invalidate results as underlying data changes. No cache keys to design, no TTLs to tune, no invalidation logic scattered across the application. That's the model Readyset uses: caches are automatically updated from the replication stream as underlying data changes, so freshness stops being something you maintain by hand.

🔍 What We're Watching in the Database Ecosystem

How Much Will Your Cloud Bill Increase in 2026?

A clear breakdown of why database infrastructure is about to get more expensive: an ongoing DRAM shortage, driven by AI datacenter demand soaking up memory production, is pushing server hardware costs up 15-25%, and OVH Cloud has forecast 5-10% cloud price increases between April and September 2026 while the big three hyperscalers stay quiet. The part worth flagging for database teams: memory-heavy managed services like RDS carry more of that increase than baseline compute, so the workloads you'd least want to pay more for are the ones most exposed.

Caching in 2026: Fundamentals, Invalidation, and Why It Matters More Than Ever

A clear walk-through of the parts of caching people tend to conflate, including the distinction between invalidation and eviction. Caching can improve performance and scale when databases or services become bottlenecks, but with standard caching every performance gain comes with the challenge of deciding when cached data is no longer accurate.

In Case You Missed It

AI Is Querying Your Database. Are You In Control?: Our CEO Gautam Gopinadhan took the stage at Web Summit Rio last week to discuss how AI-generated SQL is changing database workloads. As AI agents begin querying production databases directly, teams face new challenges around unpredictable traffic, scaling, and performance that traditional database architectures weren't built to handle. Watch here.

Know a database aficionado who'd appreciate this? Forward it their way.

Get Readyset Weekly in your inbox

One email a week — what shipped, what we learned, and what is worth reading.