Decision guide

Scaling Reads: Cache, Replicas or Read Models?

Reads are overloading the database — where should they go?

Side by side

CriterionFix queries and indexesCache (HTTP/CDN and Redis)Read replicasRead models / materialized views
StalenessNoneTTL / invalidation lagReplication lag (ms–s)Refresh/consumer lag
Scale gainedOften 10×+ for the fixed queryVery high for hot keysLinear per replicaHigh for the precomputed queries
ComplexityLowMedium (invalidation, stampedes)Medium (routing, lag)Medium–high (pipelines, rebuilds)
CostLowestLow per requestA full database per replicaStorage + pipeline

When to choose each

Fix queries and indexes

Measure with pg_stat_statements; fix N+1, missing indexes and OFFSET pagination.

Choose when

  • Always first
  • A few statements dominate total time

Avoid when

  • Load is already efficient per query and simply too high

Cache (HTTP/CDN and Redis)

Serve repeated reads from memory or the edge.

Choose when

  • Hot, repeated reads with tolerable staleness
  • Read traffic far above write traffic
  • Expensive computed responses

Avoid when

  • Data that must be exactly fresh (balances, checkout stock)
  • Highly personalized, low-reuse responses

Read replicas

Copies of the database that serve reads, slightly behind the primary.

Choose when

  • Many varied reads that can't be cached well
  • Analytics or reporting isolation

Avoid when

  • Read-after-write paths without read-your-writes routing
  • Write-heavy load

Read models / materialized views

Precompute the shape reads need (summaries, search indexes, denormalized views).

Choose when

  • Expensive aggregates or joins on every read
  • Search and filtering across many fields

Avoid when

  • Rapidly changing data needing immediate consistency
  • Small datasets

Verdict

Fix queries first, then cache what's hot and tolerates staleness, add replicas for varied reads with read-your-writes routing, and build read models for expensive aggregates and search. Classify every read by its freshness need before choosing.

Learn more

Sources