A curated atlas of great open-source code

Learn system design by reading the code that proved it

28 canonical codebases, walked file-by-file at a pinned commit — the trade-offs frozen into real code, not folklore. Every page reads aloud, every system gets an “explain it like I'm 10”, every walkthrough steps through the request path.

Why an atlas, not another book

Books teach system design in the abstract: "use a write-ahead log", "prefer event loops for I/O-bound work", "content-address your data". Those are true and useless until you have watched a real codebase pay for them — where the loop lives, what the log record looks like, what trade was made to get there.

The atlas points at 34 (and growing) canonical codebases and walks through the decisions frozen into their code: the two or three defining trade-offs, the data structures that carry the design, the concurrency model, the seams where the system extends. You read the atlas entry, then you read the code alongside it. That is the whole method.

The deep-dives

Redis an event loop plus data structures built like they're the product Like you're 10: A restaurant with exactly one chef. Redis is a kitchen with one chef (one thread runs all commands) and a doorbell — the event loop — that rings whenever a table needs something or a timer goes… cachedatabasenetworkingmoderate SQLite a database as a layered library — and a query as compiled bytecode Like you're 10: A magic cookbook that lives inside your toy box. Most databases are restaurants: you phone a waiter (a server process) who talks to the kitchen. SQLite is a cookbook that lives in YOUR box —… databasestorage-enginedemanding git the version control that is really a content-addressed database Like you're 10: A photo album where nothing is ever erased. Every time you save your drawing, git takes a brand-new photo of each changed file (a blob ), a new photo of each folder's list of contents (a tree ),… vcsstorage-enginemoderate LevelDB the LSM-tree in its teachable form — logs, levels, and immutable tables Like you're 10: A diary, a scratch page, and a tidy-up robot. When you tell LevelDB something ( Put ), it does two fast things: writes the fact in pen in a diary you never re-read (the WAL — its only job is to… storage-enginemoderate nginx shared-nothing processes, state machines, and ownership by lifetime Like you're 10: An ice cream shop where every order gets a tray. nginx is a shop with one manager (the master process) who never scoops ice cream — the manager's whole job is hiring, watching, and replacing scoop… web-serverproxy-lbdemanding PostgreSQL the relational server as a federation of cooperating processes Like you're 10: A bank where every customer gets their own clerk — and receipts are never erased. Walk in (connect) and the bank manager (the postmaster) assigns you a personal clerk (a backend process) who stays… databasestorage-enginedemanding Kafka the append-only log as an operating system for data Like you're 10: A conveyor belt of numbered boxes. Kafka is a very long belt that only moves forward (the append-only log). Senders drop sealed boxes onto it (batches of records), and each box gets a number as it… queue-logdistributedstorage-enginedemanding Kubernetes desired state + reconcile loops — an operating system as a control system Like you're 10: A wish list pinned to the fridge, and a helper robot that keeps comparing. You never tell the house what to do step by step — you pin a wish to the fridge: "5 cupcakes on the table" (a spec:… orchestrationcontainerdistributeddemanding CPython the interpreter that won by making extensions easy Like you're 10: A puppet theater where every puppet wears a name tag. Every puppet (every value) wears a tag that counts how many hands are holding it (the reference count). The moment the count reaches zero,… runtimelanguagemoderate Moby/Docker images as content-addressed layers, execution as delegation Like you're 10: A program shipped as a stack of clear plastic sheets. Instead of mailing someone a whole heavy toy box (a whole computer disk image), Docker ships a stack of clear sheets: each sheet has part of… containerdemanding VS Code extension architecture as the product — process isolation and protocol seams Like you're 10: A school where guest teachers get their own room — never the office. VS Code is a school. The front office (the workbench — the UI you see) never lets guest teachers (extensions) teach from inside… editormoderate etcd Raft as a deterministic state machine, keyspace as MVCC history Like you're 10: A club notebook that most members must agree on. etcd is a club with one precious notebook (the keyspace). Any important note (a Put) is only written after MOST members agree on the next line (a… distributeddatabasedemanding Elasticsearch a search engine behind a friendly distributed façade Like you're 10: A library with a "today" drawer. When a new book's index card arrives, the librarian drops it into a "today" pile (the in-memory buffer) — writing to the pile is instant, so nobody waits. Every… search-enginedistributeddatabasedemanding Memcached the cache that kept the server dumb Like you're 10: A wall of mail slots in fixed sizes. Memcached is a post office wall where every slot is one of a few fixed sizes (slab classes): small, medium, large. When a letter arrives (a SET ), the clerk… cachemoderate Apache httpd the web server as a hook-running extension platform Like you're 10: A restaurant where the conveyor belt is the restaurant. In Apache's kitchen there is no head chef doing everything — there is a conveyor belt (the filter chain: buckets of soup/bytes pass from… web-serverdemanding ZooKeeper consensus wrapped in a tiny ordered filesystem Like you're 10: A notebook copied identically across several offices. Every office (an ensemble server) keeps the exact same notebook of pages (znodes: /app1/leader, /jobs/17/status ). Writes always go to head… distributeddatabasedemanding NATS a subject trie with a wire protocol small enough to memorize Like you're 10: A switchboard for mail addressed by topic. Anyone can shout "letter for orders.new.eu!" (PUB) and hand it to the operator; anyone can say "I want everything about orders.*.eu " or "everything… queue-lognetworkingmoderate libuv the event loop distilled into a portable, embeddable library Like you're 10: A receptionist who never watches anything for long. The receptionist (the event loop) keeps a wall of numbered mailboxes — one per thing she watches (a socket, a timer) — and a big board that… runtimenetworkingmoderate runc a container is a config file plus a choreographed chain of syscalls Like you're 10: A porter who builds you a hotel room and then quits. The hotel is the Linux kernel (it owns all the rooms forever). The porter (the runc run you type) reads your wishlist ( config.json: one room,… containermoderate Lua one tagged union, a register VM, and the friendliest embedding API in the business Like you're 10: A craftsman's workshop that fits inside anyone's garage. The big machine (your game, your server — the host program, written in C) installs a small workbench (the Lua interpreter, lua_State ) in… languageruntimemoderate Envoy a fleet of single-threaded proxies steered by an API Like you're 10: A sorting facility where every sorter has their own manual — and head office rewrites the manuals by phone. Letters (connections) arrive at loading docks (listeners) and ride conveyor belts… proxy-lbdistributeddemanding curl a transfer state machine designed to live inside someone else's event loop Like you're 10: A travel agency that never insists on driving you there. You can say "get me this webpage" (the easy interface: curl_easy_perform ) and the agency does everything while you wait outside. But you… networkingmoderate llama.cpp LLM inference with no framework — tensors, a graph, and quantization as the product Like you're 10: A bakery that rebuilds its conveyor belt for every cookie — and stores flour in tiny compressed jars. The recipe (the model architecture, one C++ builder per model family) says: mix, shape, bake,… ml-frameworkmoderate Node.js the boundary is the platform — an engine and a loop behind one JS-facing seam Like you're 10: A factory with one translator's desk. The factory floor is full of machines that only speak Machine — sockets, files, clocks (libuv handles and OS syscalls) — and one brilliant engineer who only… runtimedemanding FFmpeg two thousand components behind four boring interfaces Like you're 10: A factory where every machine speaks the same plug. Packages arrive from trucks (the demuxers take containers apart into packets — still-wrapped presents). Unwrapping machines ( decoders ) open… medianetworkingdemanding PyTorch the forward pass that records its own graph Like you're 10: A restaurant where every cook writes a receipt for what they made, and at closing time a cleanup crew walks the receipts backwards to pay everyone back. When you order (call torch.mul in Python),… ml-frameworkdemanding Servo a browser engine as a supervised graph of message-passing pipelines Like you're 10: An office building where each website gets a workroom, run by a building manager who never does any of the tenants' work herself. The building manager (the Constellation thread) assigns rooms… browser-enginedemanding HAProxy a proxy where every hot path runs against a visible budget Like you're 10: A restaurant where every waiter works alone with a to-do list that is never allowed to get long. Each waiter (a thread) has a to-do list ordered by when you wrote the item down (the run queue, an… proxy-lbdemanding

How to use the atlas

  1. Pick a domain you want to understand — cache, storage engine, VCS, web server, database, runtime... Browse catalog.yaml (entries are tagged by domain and difficulty).
  2. Read the catalog entry's "why" paragraph — it tells you what design lesson this codebase is unusually good at teaching.
  3. Shallow-clone the project so you can follow along:
    mkdir -p clones && git clone --depth 1 <repo-url> clones/<id>
    
    Deep-dives pin the commit they were written against; expect small drift, the file/function landmarks are stable for years in mature projects.
  4. Read the deep-dive top to bottom once (architecture → data structures → concurrency → trade-offs), then work the reading path in the actual clone, opening every cited file. The reading path is the product; the prose is the guide.
  5. Steal the lessons — each deep-dive ends with "what to steal": transferable design moves you can apply to your own systems.

Time budget: a deep-dive plus its reading path is a focused 3–8 hours (depending on the entry's difficulty rating). Do not rush the reading path.

The wider catalog

The atlas tracks 34 projects; 28 have deep-dives so far. Grouped by primary domain:

os-kernel (1)
  • Linux kernel ↗cataloged
    The most-used piece of software in existence, and the clearest proof that architecture beats features: “everything is a file” (VFS over wildly different filesystems), a driver model that lets thousands of vendors add…
cache (2)
  • Redisdeep-dived
    The canonical answer to "what does an I/O-bound server look like when you optimize for simplicity under load": a single-threaded event loop plus purpose-built data structures (SDS strings, incremental-rehash hash…
  • Memcacheddeep-dived
    The original "scale the database with a cache layer" tool that won the mid-2000s web by being aggressively boring: a text protocol you can speak with netcat, a slab-class allocator that fights fragmentation by never…
database (2)
  • SQLitedeep-dived
    The most deployed database on earth — in every phone, browser, and airliner — because of one architectural choice: strict layering with every environment assumption isolated behind one interface. Tokenizer → parser →…
  • PostgreSQLdeep-dived
    The reference relational server that outlived every proprietary rival: process-per-connection (not threads), MVCC via tuple versioning, write-ahead logging, and a planner/executor split that has shaped every database…
storage-engine (2)
  • LevelDBdeep-dived
    The cleanest published LSM-tree (log-structured merge tree) engine, small enough to read in a week: a memtable backed by a skip list, an append-only WAL, leveled compaction of immutable SSTables, and a manifest that…
  • RocksDB ↗cataloged
    LevelDB's design pushed to production extremes: column families, tiered compaction, rate limiting, Bloom filters per level, transactions via a write batch pipeline. Read after LevelDB to see what the elegant textbook…
web-server (3)
  • nginxdeep-dived
    The web server that broke Apache's thread-per-connection model and owns the top of the web-tier market share because of it: a master/worker process model where a supervisor holds the listening sockets, workers…
  • Apache httpddeep-dived
    The server that dominated the early web and stayed dominant for decades because of one architectural bet: extensibility as the product. The module API (handlers, filters, per-directory config like .htaccess) and…
  • Caddy ↗cataloged
    A modern web server where the idioms do the hard work: Go's goroutines where nginx hand-rolls state machines, an HTTP middleware chain, and automatic-HTTPS as a first-class subsystem rather than a bolt-on. Read…
proxy-lb (2)
  • HAProxydeep-dived
    The load balancer that refuses to drop traffic: run queues and tasks instead of threads, zero-downtime reload via socket handoff, and obsessive per-connection memory accounting (pools + ebtree). Teaches how to design…
  • Envoydeep-dived
    The modern data-plane architecture: an event loop per worker thread, filter chains as the extension model (network filters, HTTP filters), xDS as the control-plane API, and stats/tracing built into the skeleton.…
vcs (1)
  • gitdeep-dived
    A distributed VCS that displaced every centralized incumbent because of one structural bet, not features: a persistent, content-addressed object database (blobs/trees/commits/tags under a DAG of refs) with porcelain…
queue-log (2)
  • Apache Kafkadeep-dived
    The nervous system of every large data platform, and it won that slot with a design inversion: not a smart message router but a dumb, append-only, partitioned log that exploits the one thing disks and networks do at…
  • NATSdeep-dived
    A messaging server whose entire protocol is a handful of text lines (INFO/CONNECT/PUB/SUB), with subject-based addressing (foo.*.bar) and per-subscription goroutine delivery. Teaches protocol minimalism and the…
runtime (4)
  • Node.jsdeep-dived
    V8 + libuv + a module system, glued so that JavaScript became a server language. Teaches the embedding lesson: how you wrap an engine (handles/scopes/contexts in V8) and an event loop (libuv) into a coherent…
  • CPythondeep-dived
    The most widely run language implementation on earth, and it won that position through design decisions that predate its hype: a stable C API + reference-counted PyObject model that made native extensions…
  • libuvdeep-dived
    The portable event loop, distilled: poll/epoll/kqueue/IOCP behind one API, plus the async-cross-thread escape hatch (uv_async_t) and thread pool for blocking work (fs, dns). Small enough to read completely in a…
  • V8 ↗cataloged
    The fastest widely-deployed JS engine: Ignition interpreter, TurboFan optimizing compiler, concurrent+incremental marking, generational heap, hidden classes. Included for influence and as a reference, not a first…
language (1)
  • Luadeep-dived
    A whole language — lexer, parser, register-based VM, incremental GC, and the friendliest C embedding API ever designed — in ~30k lines with almost no dependencies. Teaches that a runtime's power comes from a few…
search-engine (1)
  • Elasticsearchdeep-dived
    Search made universally accessible — and it won by API design as much as by engineering: Lucene's inverted index wrapped in a JSON over HTTP interface with schema-on-the-fly, sharding and replication declaratively…
orchestration (1)
  • Kubernetesdeep-dived
    The operating system of the datacenter, and the biggest architectural bet in modern infrastructure: declarative desired state + level-triggered reconcile loops (controllers) instead of imperative actions. Users…
container (2)
  • runcdeep-dived
    What "a container" actually is, in ~30k lines: parse an OCI bundle (config.json), clone(2) with namespaces, set up cgroups, pivot_root, exec. Teaches the Linux container primitives one syscall at a time — the rare…
  • Moby (Docker)deep-dived
    The tool that made containers mainstream, and it won on a packaging design decision: images as immutable, content-addressed, layered tarballs with copy-on-write union mounts, plus one command (dockerfile → docker…
ml-framework (2)
  • PyTorchdeep-dived
    A tensor library that became the dominant training framework via one architectural bet: define-by-run autodiff, where the forward pass records a dynamic graph and backward walks it. Teaches how to layer an eager…
  • llama.cppdeep-dived
    LLM inference with no framework: ggml tensors, memory-mapped weight files, quantization as first-class, graph-built-per-model eval loops. Teaches performance engineering as architecture — how batching, KV cache…
browser-engine (2)
  • Servodeep-dived
    A browser engine built as independent crates (html5ever parser, stylo style system, WR/WebRender compositor) with task-based parallelism instead of one monolithic main thread. Teaches how to decompose a gigantic…
  • Chromium ↗cataloged
    The most dominant browser engine ever and the codebase behind Chrome/Edge/Opera: multiprocess sandboxing (browser vs renderer vs utility processes), Mojo IPC, the V8/Blink split. Its process architecture — splitting…
distributed (2)
  • etcddeep-dived
    Raft consensus in production clothes: a WAL-backed state machine, leader election, log replication, and snapshot/compaction — plus the watch API that turned it into Kubernetes' brain. Teaches the gap between a…
  • Apache ZooKeeperdeep-dived
    The coordination kernel beneath the entire Hadoop-era stack: it won because it turned consensus into a usable product — a tiny ordered namespace of znodes backed by an atomic-broadcast (ZAB) log, with ephemeral nodes…
editor (2)
  • VS Codedeep-dived
    The most-used code editor of the era, built on an unfashionable bet that won: Electron (Chromium + Node) for the UI, with all editor intelligence pushed out of the renderer into a separate extension-host process that…
  • Neovim ↗cataloged
    A 40-year-old editor architecture modernized without forking its soul: core/editor split, msgpack-RPC as the extension seam (clients, LSP, plugins all speak it), and Lua as embedded language replacing ad-hoc…
networking (1)
  • curldeep-dived
    Every protocol, every platform, zero dependencies, one API — for decades. Teaches portability as an architectural commitment (curl_multi for event-loop integration, a build system that spans embedded to…
media (1)
  • FFmpegdeep-dived
    The universal media toolbox: demuxers, decoders, filters, encoders, muxers as registered components behind lavf/lavc/avfilter APIs, with a directed-graph filter engine and SIMD-per-architecture optimizations. Teaches…