Skip to content
About
Main content

Summary and key takeaways

The currencies

CurrencyWhere it appearsWhat it buys
Read, write and space (the RUM triangle: optimize any two and the third degrades)Lookup and ordering structures (Lookup structures and Ordering structures)Fast point lookup, fast range scans, or fast ingest, never all three
CorrectnessProbabilistic structures (Probabilistic structures)A change of complexity class: tiny state for distinct counts, membership, frequencies, quantiles, similarity
Space turned into speedBit-level and (Bit-level structures) data that is queryable in compressed form; compactness pays at memory-tier boundaries
Concurrency-friendly structures (Concurrency-friendly structures)The only cost that grows superlinearly (and can go negative) with the resources you add

What each article taught, in one line

  1. The big picture: structures are bets priced in read, write and ; the medium charges per dependent fetch.
  2. Lookup structures: hash tables follow the queueing curve of the ; B+trees have a set by page size (about 680 for 16 KB); buy write with ; , , , perfect hashing and each fit one question.
  3. Ordering structures: a answers top-k in O(n log k) with tiny memory; is set by and range partition boundaries; merge is the universal primitive; sliding windows depend on the algebra class of the aggregate.
  4. Probabilistic structures: Bloom, cuckoo and give one-sided membership answers; Count-Min, , , and top-K trade a controlled error for tiny, mergeable state; error falls as 1/√m.
  5. Bit-level structures: , /select and succinct structures stay queryable while compressed; work only if data is clustered.
  6. Concurrency-friendly structures: partition to a single writer, do not mutate, or gamble and retry, in that order of preference. (a 40–100× penalty) is physical with an address. Safe reclamation is bounded by the slowest reader.
  7. Putting the pieces together: four compositions cover most real systems.

The four compositions

  • : zone map, , sparse index, block scan; each stage has and is cheaper than the next.
  • : mutable buffer, , background merge, a manifest and a ; the merge policy is the RUM dial.
  • : dictionary, or run-length , statistics, optional byte codec; encode first, compress last.
  • : range-partition, run a local structure, merge; skew is the universal failure.

The laws

LawIn one sentence
A gap between what you want and the unit the machine handles creates amplification; stacked layers multiply it
Batch-size lawFixed cost per operation gives a natural batch size; as hardware speeds up, the fixed cost moves up into software
In-flight work = throughput ×
Costs are never removed, only moved
Variance costs more than volume
A layout that cannot update in place grows an indirection layer and a collector, and the collector's progress is bounded by the slowest reader
Growth lawA fixed rate meeting exponential growth breaks designs
Independence is assumed everywhere and true almost nowhere
Contended resources cost 1/(1 − ρ): flat, then vertical
Randomness can replace coordination, at a price in worst-case guarantees
Error ∝ 1/√m: four times the memory halves the error
Only operations that can be combined from partial results distribute
(candidate)Compactness pays discontinuously, at memory-tier boundaries
Contention is set by which cache lines are written, not by which operations conflict

Equations worth remembering

EquationMeaning
fanout ≈ page size ÷ (key + pointer size)How many keys one page-sized node can route
linear-probing miss ≈ ½(1 + 1/(1−α)²)Hash table cost at load factor α: 2.5 probes at 0.5, about 50 at 0.9
WAF-like ratio: page size ÷ row sizeAmplification when you update one row in a page
Concurrency = Throughput × LatencyHow many requests to keep in flight; also the size of a bounded
C(N) = N / (1 + α(N−1) + βN(N−1)), peak at N* = √((1−α)/β)Coordination makes throughput peak and then fall

Patterns that repeat

  • Match granularity to the transfer unit (fanout, fan-in, page size, padding, batch publishing).
  • Immutable layout ⇒ indirection layer + collector, from SSD translation layers to LSM manifests, table snapshots, and memory reclamation. VACUUM RETAIN 168 HOURS and a hazard-pointer scan are the same mechanism 12 orders of magnitude apart.
  • Make growth not relocate (, , ).
  • Bin the domain; discard the dominated; adapt the representation to local density; use two random choices.
  • Rebuild-only structures are free riders inside systems that already rebuild.
  • When the bet is wrong the loss is a cliff, not a slope: , full scans, degenerate joins, useless zone maps, retry storms. Averages hide cliffs; watch the tail and the skew.

Parcelo in the end. Arjun's one-page design: single-writer shards with rings; a buffer-runs-merge write path with leveled merging; a pruning cascade for reads; a columnar stack with mergeable for reports; persistent index snapshots with reclamation. For each choice he can state the bet, the currency, and the cliff.