Skip to content
Free · MIT licensed · 23 chapters

Data structures, down to the cache line and out to the cluster.

Most books stop at Big-O. This one shows what the machine actually does — cache misses, memory layout, branch predictors — and how the systems you use every day, from Redis to OpenSearch, turn these structures into infrastructure that scales.

Below are two loops with identical complexity. Run them on your own hardware.

Live measurement

Same operations. Same asymptotics. Same code path.

Two pointer chases over an identical 32 MiB array. One follows i → i+1; the other follows a random cycle. Big-O calls both O(n) and cannot tell them apart.

takes about 4s · nothing leaves your browser

From the cache line to the cluster

Each structure is followed from what the CPU does with it — cache, memory layout, branch prediction — up to how it shards across a fleet of machines. The span no other DSA book covers.

Measured, not asserted

The benchmarks run in your browser, on your CPU, while you read. No screenshots of someone else's laptop, and no numbers you have to take on faith.

Connected to production

Every chapter ends where the structure actually ships — Redis, Postgres, the Linux kernel, OpenSearch shard routing — in modern C++ that compiles, with the invariants and failure modes spelled out in every chapter.

The book

23 chapters, about 600 pages. Free forever.

Foundations

Linear Structures

Non-Linear Structures

Algorithm Design

Advanced Topics

Storage Engines at Scale