Readyset Weekly: Issue 20
Materialized Views vs. Query Caching: Which One Should You Use?
When queries start dragging, engineers often reach for materialized views or query caching. Both reduce redundant computation, but the better fit depends on freshness needs, write patterns, and workload shape.
Materialized Views
- Best suited for analytics and reporting.
- Precompute results like daily sales by category or monthly churn by region and store them as tables.
- Pros: Predictable performance, less load on the primary database.
- Cons: Typically less fresh, though some databases now support incremental or near-real-time updates.
Query Caching
- Ideal for high-volume, user-facing reads where latency and freshness are critical.
- Used for things like latest trades in finance apps, activity feeds in SaaS, or items in stock in e-commerce.
- Pros: Serves repeated queries from memory, avoiding database hits entirely.
- Cons: Harder to manage correctness; invalidation logic is complex and cache hit rates drop for highly dynamic queries.
Most production systems use both: materialized views for dashboards and caches for real-time features. Traditionally, you had to choose between speed and correctness. Readyset removes that tradeoff by combining caching performance with materialized-view consistency.
🔍 What We're Watching in the Database Ecosystem
The future of agentic coding with Claude Code
Boris Cherny and Alex Albert from Anthropic explore where agentic coding is today and where it's headed, how coding models are evolving, and what went into making Claude Code easy to tinker with. Boris also drops some of his go-to tips for getting the most out of Claude Code.
PostgreSQL 18 eyes analytics boost and distributed future
PostgreSQL 18 is set to land this month with a major boost for analytics: a new async I/O subsystem showing 2-3x faster performance on read-heavy workloads, plus UUID v7 for distributed systems. See what's coming in the release.
The Fastest Way to Insert Data to Postgres
Sometimes the old tricks win. Using Postgres's COPY still beats JDBC for bulk ingest. This engineer combined Spark's parallelism with COPY streams to load 22M rows in record time.
In Case You Missed It
New on our Blog
Collation improvements in Readyset
Sorting isn't simple: accents, case, contractions, and language rules break naïve bytewise order. Here's how we upgraded Readyset with ICU4X (and why we had to add collation keys ourselves).
Get Readyset Weekly in your inbox
One email a week — what shipped, what we learned, and what is worth reading.