How to serve more readers without making one system do all the work.
If many users read the same product data, what are three ways to avoid hitting one database repeatedly?
Before reading, choose whether this is a cache problem, replica problem, CDN problem, or precompute problem.
Read scaling returns in feeds, catalogs, URL redirects, profile pages, and media playback.
Many products are opened far more often than they are changed. One profile gets edited occasionally but viewed constantly. One short URL is created once and clicked thousands of times.
When reads dominate, the problem is not always "the database is slow." Sometimes the same object is fetched repeatedly. Sometimes the query itself is expensive. Sometimes the real pain is assembling the response. Sometimes the content is just too far from the user. The fix should come from the type of slowness.
The strong answer chooses the technique from the shape of the problem, not from habit.
Scaling reads means adding Redis.
Read scaling is about serving copies safely: caches, replicas, CDNs, indexes, and precomputed views all help different read patterns.
Name the read path, freshness tolerance, and source of truth before picking the read-scaling tool.
| Read-scaling choice | Good when | Weak when | Interview line |
|---|---|---|---|
| Keep reads on one primary store | Traffic is still small and the read path is simple. | The primary becomes the read bottleneck or latency is too high. | I would keep the first version simple until reads clearly pressure the primary path. |
| Cache hot data Default | The same objects are requested repeatedly and slight staleness is acceptable. | Reads are highly dynamic or invalidation is harder than the saved latency is worth. | Caching helps if the same hot objects are being fetched over and over. |
| Read replicas | Many reads still need database queries and the primary should stop serving all of them. | The main pain is stale-sensitive reads, expensive joins, or response assembly rather than raw read volume. | Read replicas help when I need more database read capacity without sending every read to the primary. |
| Precomputed read view | Building the response is expensive, such as feeds, rankings, or aggregates. | The read is simple enough that precomputation adds unnecessary complexity. | If the cost is assembling the view, I would precompute that view instead of rebuilding it on every request. |
| CDN or edge cache | Static or blob content is globally requested and repeat reads are common. | Content is highly private, rarely read, or must always be fetched from origin. | A CDN helps when the read problem is global content delivery, not just database pressure. |
Do not jump straight from reading to a full answer. First see the shape, then complete part of it, then answer alone.
I would cache product details that change rarely, but keep inventory or price freshness rules explicit.
For the catalog prompt, mark which reads can be stale and which ones affect money or trust.
Design the read path with one copy layer and one fallback path.
Before moving on, turn recognition into production. Close the model answer, answer from memory, then retry one small slice.
Say the chapter's core idea without looking. Then name one related idea from an earlier chapter.
Change one constraint in the practice prompt and answer again in half the time.
Use the rubric to pick one dimension below 3, then retry only that dimension.
Repeated lookup, DB pressure, expensive assembly, or distant content.
Cache, replicas, precompute, or CDN.
Replicas add read capacity. They do not make bad queries cheap.