Readyset Weekly: Issue 47
Application Caching vs SQL Caching: Where the Complexity Lives
When read latency starts to climb, adding a caching layer is usually one of the first solutions teams reach for. There are two common ways to go about it: build a caching layer at the application level using a key-value store, or cache at the SQL layer so the database handles it. Both can work. But they carry very different tradeoffs, and the one you choose early tends to shape how your stack evolves for a long time.
- Application-level caching puts the logic in your code. You decide what to cache, serialize results into keys, set TTLs, and write invalidation logic. TTL-based freshness is a bet that your data won't change in ways that matter before the cache expires. For workloads where data changes frequently and queries are complex, you're constantly fighting to keep cached results correct.
- SQL awareness and wire-protocol compatibility. By leveraging wire-protocol compatibility and schema awareness, SQL-native systems like Readyset transparently intercept queries to perform incremental view maintenance, automatically synchronizing cached result sets as underlying data to eliminate the need for manual invalidation.
- Operational overhead compounds quietly. Application-level caches require maintaining a separate system, managing memory, handling warm-up after restarts, and keeping results consistent across services. And every new feature your team ships carries the same tax, what to cache, how long, and how to keep it coherent. Getting started is straightforward. Keeping it healthy over time is a different story.
- When each approach makes sense. Application-level caching can work well when results are simple, relatively static, and the team has the capacity to own manual cache logic over time. SQL-native caching tends to be a better fit as workloads grow more complex, data changes frequently, and correctness under load is non-negotiable.
For a closer look at what these tradeoffs look like in practice, this post on the hidden complexity of scaling Postgres is worth the read.
🔍 What We're Watching in the Database Ecosystem
As AI agents move from experimentation into production operations, governance is becoming an engineering concern, not just a compliance one. This piece outlines five pillars: human oversight of high-impact actions, guardrails for what agents are allowed to do, building agents secure by design, full transparency into decision paths, and measuring both technical performance and business impact.
Your LLM Doesn't Write Correct Code
This post highlights a growing failure mode of LLM-generated code: it often compiles and passes tests but hides mistakes that only appear under real workloads. In database systems, where performance invariants like index lookups or transaction behavior matter, plausible code can be orders of magnitude slower than correct implementations.
In Case You Missed It
New on our blog: Replication Internals: Decoding the MySQL Binary Log, Part 2
Marcelo continues the series with a closer look at how MySQL binary log events are structured at the byte level. If you're building CDC tooling, working with replication, or just want to understand what's actually happening under the hood, this is the next read.
Get Readyset Weekly in your inbox
One email a week — what shipped, what we learned, and what is worth reading.