LESSON 08 / 15·2 min readAdvanced

Cache, CDN, replica or shard: which solves what?

01 Understand02 Recall03 Prepare

Understand the concept

Caches, CDNs, replicas and shards address different kinds of repeated work or load. A cache reuses a result, a CDN brings cacheable content closer to users, a replica copies data, and a shard owns a subset of data. Combining them requires freshness, routing and recovery rules rather than simply adding more boxes.

Important ideas

  • Cache avoids repeated work; CDN serves cacheable content near users.

  • Read replicas spread reads but may lag behind writes.

  • Shards split data across nodes; choosing the shard key adds design complexity.

  • A read replica may serve stale data, while a shard changes where authoritative data is stored and which node a query must reach.

PAUSE & RECALL

Can you explain it without the notes?

Cache, CDN, replica or shard: which solves what?

Use your own words. Explain an example and one limitation before checking the explanation.

Check your explanation

Caches, CDNs, replicas and shards address different kinds of repeated work or load. A cache reuses a result, a CDN brings cacheable content closer to users, a replica copies data, and a shard owns a subset of data. Combining them requires freshness, routing and recovery rules rather than simply adding more boxes.

CONNECT IT TO YOUR INTERVIEW

Turn this concept into a clear answer.

  • Connect each component to a measured bottleneck and describe its failure behavior.
Practice this concept
YOUR NEXT STEP

Keep connecting the ideas.

Next lesson: How does cache-aside work?

Adapted from 07_SYSTEM_DESIGN_ARCHITECTURE.md · “Cache, CDN, replica or shard: which solves what?”. Examples are study fragments; framework behavior can depend on your version.