Subject
System design
How large systems are put together and why. Twenty articles in two halves: eight on the concepts, then twelve worked designs that apply them. Meant to be read in order: each one starts with a mind map for fast revision, then explains every concept with a diagram and the real systems that use it.
Articles
-
1 · Networking and edge routing
One request's journey: DNS, anycast, CDNs, load balancers, proxies, API gateways, and real-time connections.
-
2 · Scalability and compute patterns
Horizontal and vertical scaling, microservices, statelessness, concurrency models, queues and batching.
-
3 · Storage and data systems
Choosing a data model, sharding, replication, indexes, caching, consistent hashing, denormalization and write-ahead logs.
-
4 · Distributed consensus and reliability
CAP and PACELC, Raft, idempotency, circuit breakers, rate limiting, backoff with jitter, heartbeats and failover.
-
5 · Observability and system security
Metrics, traces and logs, SLOs and error budgets, authentication, authorization and encryption.
-
6 · Messaging and event-driven systems
Queues, logs and topics, partitions and ordering, delivery guarantees, dead letters, the outbox pattern, sagas, event sourcing and stream processing.
-
7 · Search, analytics and data pipelines
Inverted indexes, BM25 ranking, vector search, OLTP against OLAP, columnar storage, the lakehouse, and batch and streaming pipelines.
-
8 · Designing a system end to end
Requirements, back-of-envelope numbers, API and data model, then worked designs for a URL shortener, a news feed and a chat service.
-
9 · Designing TinyURL
Sizing, the API and data model, code generation, the store, the cached read path, click counting, expiry, abuse and multi-region.
-
10 · Designing a distributed cache
The single node, LRU and LFU eviction, expiry, hash slots and routing, replication and failover, cache-aside, stampedes and hot keys.
-
11 · Designing a distributed rate limiter
The five algorithms and their exact behaviour, where to enforce, distributing a global limit, the counter store, fairness and what to tell the client.
-
12 · Designing a news feed
Fan-out on write against on read, the hybrid, feed storage, the social graph, fan-out workers, ranking, hydration, counters and correctness.
-
13 · Designing WhatsApp
The connection tier, the send path, the offline queue, groups, end-to-end encryption and multi-device, receipts, push notifications and media.
-
14 · Designing Uber
The location firehose, geospatial indexing with geohash, quadtrees, S2 and H3, batched matching, the trip state machine, surge, ETA and payments.
-
15 · Designing Google Drive
Content-defined chunking, deduplication, the metadata service, resumable uploads, the sync protocol, conflicts, sharing, versions and storage tiers.
-
16 · Designing YouTube
Resumable upload, the transcoding ladder and chunk-parallel encoding, packaging, the long tail, CDN delivery, adaptive bitrate, view counts and live.
-
17 · Designing Netflix
Per-title and per-shot encoding, a purpose-built delivery network with proactive fill, the playback control plane, personalization, rights and resilience.
-
18 · Designing a search engine
Crawling, deduplication, index construction, document against term sharding, fan-out serving and tail latency, ranking, and vector retrieval at billion scale.
-
19 · Designing an LLM serving system
Prefill against decode, the KV cache, continuous batching, paged attention, tensor and pipeline parallelism, scheduling, prefix caching and autoscaling.
-
20 · Designing ChatGPT
The streaming request path, conversation state and context budgeting, memory and retrieval, the tool loop, layered safety, quotas, evaluation and cost.