Q17 · How do you design read-heavy workloads for maximum throughput?

Back to 24 Architecture Questions.

The question is not “add a cache”. The axis it turns on: where the read is answered from, and what the invalidation costs. Every layer between the write and the read buys throughput by selling staleness and by charging an invalidation fee on every write. The design is the routing table between them.

The read ladder A request is answered at the cheapest layer within its staleness tolerance. On cache miss it falls through to the replica, then to the origin database, each step fresher and more expensive. FIGURE 17 THE READ LADDER Request how stale is OK Cache TTL stale Replica seconds behind Origin DB fresh, full price on miss on miss staleness tolerance cheap; stale as the TTL no invalidation, lag only always right, always slow answer at the cheapest layer that is fresh enough; every layer you keep is paid for in invalidation

What the answer should contain

Make reads cheap where they are born before adding layers. Indexes that match the query, covering indexes that answer it, projections that select the page’s shape instead of the entity. The cheapest read is the one the database does not have to work for.

Route each read class to the cheapest layer inside its staleness tolerance. The tolerance comes from the product: profile pages tolerate minutes, prices tolerate seconds, payment status tolerates nothing. The routing table is the design; the infrastructure is just the enforcement of it.

Caches serve the shared and the hot. Shared answers (catalogs, configs, rendered fragments) and hot keys, with one request refreshing the key while the rest wait, and TTLs jittered so a fleet never expires together. Per-request data does not belong here no matter how read-heavy the system is.

Replicas serve everything that tolerates lag. They cost nothing in invalidation logic: lag is automatic, measurable, and routed around. Most read-heavy systems under-use their replicas because their read path never split its classes.

Read models serve the queries whose shape is far from the write shape. Search, feeds, dashboards: prebuilt, denormalized views fed by events from the service that owns the data. The invalidation cost is the pipeline itself: a rebuild is a replay, not a scramble. This is where the heaviest read paths end up, and it is the honest version of CQRS without the ceremony word.

Measure the ladder, not just the hit rate. p99 per read class, hit rate with a staleness check, and origin QPS as the number you defend. A cache with a 95% hit rate that serves a stale price is a liability with good statistics.

Ideas worth mentioning out loud

Follow-ups to expect

Red flags in an answer

Sources