Read-heavy Systems
On this page
A product page is viewed 50,000 times for every time it changes. A news article is read by a million people and edited twice. A short link is clicked thousands of times and created once. If every one of those views runs the same database queries, the database does the same work over and over, and it becomes the bottleneck long before anything else is busy.
Systems where reads vastly outnumber writes are read-heavy. They are the most common kind in interviews, and they share one goal: answer most reads without doing the expensive work again.
How it works
Stop reads as early as possible

Each layer is cheaper and closer to the user than the one behind it. A request that stops at the CDN never touches your servers; one that stops in Redis never touches the database.
| Layer | What it serves | Typical latency | Staleness control |
|---|---|---|---|
| CDN | Public, identical-for-everyone responses and files | ~10 ms from the edge | Cache-Control, versioned URLs, purge |
| Local in-process cache | A few thousand hottest keys | microseconds | Short TTL (seconds) |
| Shared cache (Redis) | Hot objects, query results | ~1 ms | TTL + delete on write |
| Read replicas | Everything that misses the caches | 5–20 ms | Replication lag (ms to s) |
| Primary + indexes | Writes, and reads that must be fresh | 5–20 ms | Always fresh |
The numbers multiply. If each layer catches most of what reaches it, the database sees a small fraction of the original traffic, and that is the number you size it for.
Do the work once, on write

If a read needs an expensive computation, ask whether you can compute it when the data changes instead:
- Counters: store
like_countand increment it, instead ofCOUNT(*)on every view. - Denormalized fields: store the author's name on the post, so showing a post needs no join.
- Materialized views / precomputed results: "top 10 products in each category", rebuilt every minute.
- Precomputed feeds: build each user's timeline when posts are written (see Fanout).
- Search indexes: text search reads from an index built on write, not a scan.
You trade a little more write work and some consistency (derived data can lag) for reads that are a single lookup.
Decide what may be stale
Not all data needs the same freshness. Write it down per item:
- Product description: minutes is fine. Cache with TTL 10 minutes.
- Price: seconds. Short TTL plus delete on update.
- Stock at checkout, account balance: never stale. Read from the primary.
- A user's own just-saved change: must appear immediately to that user (read-your-writes), even if others see it a second later.
Trade-offs and costs
- Staleness in every layer. The more layers, the more places an old value can hide.
- Invalidation complexity: every write path must delete or update the right cache keys and derived data.
- Hot keys: one viral item can overload one cache shard. Use local caching, key replication, or the CDN.
- Stampedes: a popular key expiring sends a burst to the database. Use rebuild locks, jittered TTLs, early refresh.
- Cold starts: after a deploy or cache flush, hit rates drop to zero. Warm caches or ramp traffic gradually.
- Cost: cache memory and replicas cost money, but usually far less than a database big enough to take all reads.
When to reach for it
You are in a read-heavy design when the prompt sounds like: view a product, read an article, open a profile, redirect a short link, browse a catalog, look up a business, watch a video. Confirm the ratio early: "I'll assume about 100 reads per write; tell me if that's wrong." The design then follows the layers above.
If the ratio is closer to 1:1, or most reads are unique (each user sees different data that is rarely reread), caching helps less. Focus on indexes, partitioning and precomputation instead.
Example
A course catalog for the course site. Assumptions: 100,000 reads per second at peak, 20 lesson edits per minute, 50,000 lessons, lesson pages identical for all users except progress.
- CDN: the lesson page shell and images are public; cache at the edge for 5 minutes with versioned asset URLs. Assume 60% of requests end here.
- Split personal from public: progress ("you finished 3 of 12") comes from a separate small API call, so the big page stays cacheable.
- Local cache: each service instance keeps the top 1,000 lessons for 10 seconds.
- Redis:
lesson:{id}with cache-aside, TTL 10 minutes plus jitter; the edit path writes the database and deletes the key. - Database: two read replicas for misses; progress writes and reads go to the primary.
- Precompute: "most popular lessons this week" is rebuilt every 5 minutes into a single Redis key instead of an aggregate query per view.
- Result: around 1,000 reads per second reach the replicas, which two small replicas handle easily.
Common mistakes
- Not stating the read/write ratio before designing.
- "Add a cache" without saying what is cached, the key, the TTL and invalidation.
- Caching personalized pages at the CDN or mixing personal data into cacheable responses.
- Computing on every read what could be precomputed on write.
- Ignoring hot keys and stampedes in a system with viral content.
- Serving data that must be exact (balance, stock at checkout) from a cache.
Say this in the interview
"This is read-heavy, about 100 to 1, and a few minutes of staleness is fine for lesson content. So reads stop as early as possible: the CDN serves the public page, each instance has a tiny local cache for the hottest lessons, Redis with cache-aside handles the rest, and replicas take the misses. Progress is personal and fresh, so it's a separate call to the primary. Counts and popular lists are precomputed on write, and hot keys get a rebuild lock so an expiry doesn't stampede the database."
Used in
- Cache, CDN, Database, Fanout (Read vs Write).
- Design a URL Shortener, Design a News Aggregator, Design a Type-ahead System, Design Google Maps.