system_design / README.md

Scaling building blocks

1 min read index source

Scaling building blocks

The vocabulary every system design answer needs, as first-class topics rather than scattered across backend folders.

# File Covers
01 01_load_balancing_and_cdn.md L4 vs L7, algorithms, health-check failure modes, CDN caching
02 02_replication_and_consistency.md replication models, sharding, CAP/PACELC, the consistency spectrum

Deeper treatment of individual pieces lives in the backend folders: caching, sharding and partitioning, CAP/ACID, message queues.

Three precision points

CAP is about partitions, not a general “pick two”. With no partition you get both consistency and availability. PACELC is the more useful framing because it also describes the everyday latency-vs-consistency choice.

A deep health check is an outage amplifier. If the check queries the database, one database blip marks every backend unhealthy simultaneously and the load balancer removes your whole fleet.

Shard last. Read replicas, caching, vertical scaling and archiving come first. The shard key is the hardest decision to reverse, and a key that isn’t in your common query turns every read into a scatter-gather.