system-design

Part 2 — Building Blocks

The Lego bricks. Every system you will ever design is these twenty-one components, arranged differently.

Time for this part: Weeks 4–7 on the Standard track. It’s the largest part of the guide, and the one you’ll return to most.

Part 1 established the constraints. This part is the catalogue of techniques for living within them. By the end you should be able to look at any architecture diagram and know what every box does, what it costs, and how it fails.


Chapters

Traffic and the edge

# Chapter Time The problem it solves
1 Load Balancers 22 min One server isn’t enough; and how do requests avoid dead ones?
2 Proxies: Forward and Reverse 12 min Putting something useful in the middle
3 API Gateway 14 min Eight services each reimplementing auth and rate limiting
4 CDN 18 min You cannot beat the speed of light, so move the data closer

Making things fast

# Chapter Time The problem it solves
5 Caching — The Complete Guide 35 min Recomputing the same answer 50,000 times a second
14 Consistent Hashing 20 min Losing one cache node shouldn’t invalidate 75% of your keys
17 Probabilistic Data Structures 20 min “Roughly right in 12 KB” beats “exact in 800 GB”

Storing data

# Chapter Time The problem it solves
6 Databases: SQL vs NoSQL 25 min The most consequential choice in any design
7 Database Indexing 24 min The cheapest 1000× speedup in computing
8 Replication 25 min Read scaling, availability, and disaster recovery
9 Sharding & Partitioning 28 min Scaling writes past one machine — and what it costs
13 Object Storage 18 min Where the images actually go
12 Search Systems 24 min Why LIKE '%shoes%' is a design error
21 Geospatial Indexing 20 min “Find drivers near me” is a 2D query on a 1D index

Asynchrony and coordination

# Chapter Time The problem it solves
10 Message Queues & Pub/Sub 26 min Making the user wait 1.4 s for work they don’t care about
11 Apache Kafka Deep Dive 28 min N×M pipelines, and the need to replay history
18 Coordination Services 20 min Who’s the leader? Who’s alive? Who holds the lock?
19 Background Jobs & Schedulers 20 min “Run nightly” on 20 servers means 20 runs
20 WebSockets, SSE, Long Polling 22 min The server can’t call the client

Protection and identity

# Chapter Time The problem it solves
15 Rate Limiting 24 min One client shouldn’t determine everyone’s experience
16 Unique ID Generation 18 min AUTO_INCREMENT breaks the moment you shard

The five ideas that recur everywhere

Notice these turning up in chapter after chapter — they’re the actual content of this part:

  1. Move work off the critical path. Queues, background jobs, precomputation, CDNs. If the user isn’t waiting for it, don’t make them wait for it.
  2. Keep hot data close to compute. Caching, CDNs, page cache, in-process caches. Every one is the same response to RAM being 1,000× faster than disk.
  3. Trade exactness for scale. Bloom filters, HyperLogLog, eventual consistency, approximate counters. At scale, bounded error is usually cheaper than perfection.
  4. Partition to scale, replicate to survive. Sharding splits for write capacity; replication copies for reads and availability. They solve different problems and are almost always used together.
  5. Idempotency makes distributed systems tractable. Queues duplicate, retries repeat, locks expire, jobs re-run. Design operations that are safe to repeat and most of this becomes manageable.

Before moving on

You should be able to answer these without notes:

If several of those are shaky, revisit those chapters before starting Part 3 — the case studies in Part 12 assume all of it.


Next: Part 3 — Data & Storage Deep Dive — how databases actually work underneath, and how to model data for them.