Skip to content
← All issues

Readyset Weekly: Issue 9

The Hidden Performance Costs of ORMs and How to Avoid Them

ORMs can simplify development, but often slow down your database. From N+1 queries to redundant joins, they usually generate inefficient SQL that kills performance at scale.

Here are a few common pitfalls to catch early, and what to do instead:

  • N+1 queries: Triggered when fetching a list causes one query per row (ex, loading posts and authors). Instead, use SELECT … WHERE id IN (...) to batch requests and cut round trips.
  • SELECT: Pulls every column, even the ones you don’t need, increasing I/O and memory. Instead, use .select(...) or .only(...).
  • Implicit transactions: Some ORMs wrap all queries in transactions. For read-only queries, use autocommit to reduce overhead and wrap writes explicitly.
  • Unbounded eager loading: Loading deep associations can trigger massive joins. For significant relationships, use selective loading, LIMITs, or lazy loading.
  • Missing indexes: ORMs often skip workload-specific indexes. Use EXPLAIN to analyze slow queries and add indexes based on WHERE, JOIN, and ORDER BY patterns.

ORMs help you ship fast, but they abstract away SQL in ways that can hide performance problems. Readyset caches repetitive queries, reduces database load, and keeps applications fast without changing your code.

🔍 What We’re Watching in the Database Ecosystem

Performance Evaluation: AlloyDB vs Amazon Aurora for PostgreSQL Google’s AlloyDB was recently compared to AWS Aurora in a new GigaOm benchmark, and it outperformed in both throughput and cost efficiency. If you're considering performance and cost efficiency for transactional workloads, Google's AlloyDB is the best choice.

Scaling Memcached at Facebook Facebook turned Memcached into a globally distributed key-value system to serve billions of requests per second. It shows how much complexity sits behind “simple” caching at high scale, and why better query infrastructure matters.

Databricks Looks To Disrupt Legacy Database Space With New 'Lakebase' Offering Databricks challenges traditional databases with Lakebase, a managed Postgres for AI-native workloads and lakehouse integration. With branching support and 300+ early users, it positions Databricks to compete with Oracle and Microsoft in the operational database market.

In Case You Missed It

🆕 New on our Blog: A recent Reddit thread in the PostgreSQL community reminded us of the usual developer frustrations with traditional caching: manual invalidation, stale data, fragile cache logic, and more. In our latest post, we unpack why these problems persist and how Readyset’s SQL-native approach flips the script.

Get Readyset Weekly in your inbox

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