Expert · Module 27
Inside real systems
Read the data structures that real databases, caches, kernels and runtimes are built on.
So far the course drew its structures on paper; this module reads the ones that ship in production. Each lesson takes a real subsystem — a Postgres index page, a Redis sorted set, the Linux run queue, a Go map, a RocksDB compaction — traces it with numbers produced by running the actual code, and ties the engineering choices back to the modules you have already completed.
- 1Postgres B-tree indexesPro — members onlyHow Postgres stores indexes in 8 KB pages: Lehman–Yao high keys, splits that cascade to a new root, the fillfactor rule, and how dead and duplicate index tuples get reclaimed.14 min
- 2Redis sorted sets and skip listsPro — members onlyInside Redis sorted sets: why ZSCORE is O(1) while ZRANK is O(log n), how the listpack-to-skip-list conversion works, and how randomly rolled levels make ranks cheap without any rebalancing.13 min
- 3Linux red-black treesPro — members onlyHow the Linux run queue uses a cached red-black tree: weight-scaled virtual runtime that gives nice 5 its smaller share, the vruntime floor for new tasks, and what EEVDF changed in Linux 6.6.13 min
- 4How Go and Python implement mapsPro — members onlyWhy a Python dict iterates in insertion order while Go randomizes: measured resize arithmetic from CPython's dictobject.c, Go's eight-slot buckets at load factor 6.5, and what deletion really costs.14 min
- 5LSM trees in RocksDBPro — members onlyHow RocksDB answers a point lookup through a skip-list memtable, overlapping L0 files and one merged L1 run, counting probes with bloom filters off, and what compaction bills in write amplification.14 min