rgoussu@goussu: ~/library/system-design
~/library/system-design cat system-design-fundamentals.md

System design fundamentals

# The recurring building blocks of designing systems at scale — load balancing, replication, partitioning, consistency, and the trade-off vocabulary.

Conceptsaved 2026-08-08 #system-design#scalability#distributed-systems

Overview

System design is the discipline of assembling components — load balancers, caches, queues, databases, services — into a system that meets requirements for scale, latency, availability, and cost. It is fundamentally about trade-offs: every fundamental (CAP, replication lag, partitioning) is a constraint to negotiate, not a box to tick. The canonical deep treatment is Kleppmann's Designing Data-Intensive Applications.

Key points

  • Start from requirements: read/write ratio, data volume, latency budget (p99, not average), availability target — the numbers drive the architecture, not the other way around.
  • Scaling axes: vertical vs. horizontal; stateless services scale trivially, state is where all the hard problems live.
  • Core building blocks: load balancing (L4/L7), caching (cache management), replication (leader/follower, multi-leader, leaderless), partitioning/sharding (by key, by hash, rebalancing), queues & streams (async patterns).
  • Consistency spectrum: linearizable → sequential → causal → eventual; CAP and its more useful refinement PACELC (when Partitioned trade A vs. C; Else trade Latency vs. Consistency).
  • Back-of-envelope estimation: QPS, storage growth, bandwidth — sanity-check a design in minutes before committing to it.
  • Observability & failure: timeouts, retries with jitter, circuit breakers, graceful degradation — design for the failure modes, not the happy path.
  • To explore: consensus (Raft/Paxos), CDNs & edge, rate limiting, idempotency, the classic interview canon (URL shortener, news feed, chat) as practice drills.

Practice

  • Protohackers: Smoke Test (source) — a TCP echo server from spec: the smallest possible taste of sockets, servers, and reading requirements precisely.
  • Coding Challenges catalogue (source) — build the interview canon small but real: URL shortener, web server, DNS resolver — each one exercises a handful of the building blocks above.
  • System Design Primer (source) — drill back-of-envelope estimation and the classic design questions against worked solutions.
  • Build a load balancer & rate limiter (source) — two core building blocks built from scratch, then composed into an API edge and load-tested.
  • Gossip Glomers (source) — Fly.io's distributed-systems challenges: replication, ordering, and the consistency spectrum with partitions actually injected.

Related