← All lessons

Patterns

Scaling reads

Most systems read ten to a thousand times more than they write. The ladder from "add an index" to "precompute every timeline" is the same in every design, and the interview tests whether you climb it in the right order.

19 min readUpdated November 2026Premium

“Design a news feed”, “design a URL shortener”, “design a product page for a flash sale” — they look different and they are the same problem underneath. Reads dwarf writes, and one database can’t serve them all. Every answer is a choice of where to put copies of the data and how stale each copy may be.

The mistake candidates make is not a wrong technique. It is jumping straight to the most complex one — “we’ll precompute every user’s feed with fan-out on write” — before showing that the simpler ones run out.

The ladder

Climb it in order. Each rung is cheaper and simpler than the next, and most systems stop well before the top.

  1. Make each read cheap. Indexes, covering indexes, fixing N+1 queries, selecting only needed columns.
  2. Scale the box. More RAM so the working set is in memory.
  3. Read replicas. Spread reads over copies of the database.
  4. Caches. Keep hot results in memory in front of the database.
  5. Edge and CDN. Serve identical responses from close to the user.
  6. Denormalise and precompute. Store the data already shaped like the read — materialized views, read models, precomputed feeds.
The point

Every rung after the first adds a copy, and every copy can be stale. So the real question at each step is not “will this be faster” — it will — but “which reads can tolerate how much staleness”. A product description can be minutes old; the stock count at checkout can’t be one second old. Split the read paths by tolerance and put each on the right rung.

Measuring before climbing

The free version of the analysis, which already beats most interview answers:

The members’ section works through each rung’s mechanics and failure modes, and the feed problem that ties them together.

Premium

The rest of this lesson is ₹1

Replica routing and lag, cache hierarchies and hot keys, CDN for dynamic pages, CQRS and read models, fan-out on write vs read for feeds, and the interview follow-ups.

PhonePe, Google Pay, Paytm or any UPI app. Cards and net banking work too. One payment unlocks this lesson on this device.