Capstone: Quarry's Storage Engine
In short: Quarry's storage engine is every piece from this section wired
together. Writes land in a memtable, flush to an sstable, and cascade through
compaction exactly like lesson 5 — and every write also write-through-updates
an LRU cache from lesson 3. Reads check that cache first, for free; only a
miss ever touches the LSM levels, and even then a Bloom filter (section 8)
skips any sstable that provably doesn't hold the key. Running a fixed,
seeded mix of reads and writes through the whole thing gives three numbers
that actually matter in production: write amplification (what writes
cost later), hit rate (how often the cache saves a disk probe at all),
and read path length (how many probes a miss costs when it does happen).
None of those three numbers can be reasoned about separately — they trade
against each other through memtable_limit, compaction_threshold and
cache_capacity, and the only way to see the trade is to run it.

Wire the cache in front of the LSM levels
A write touches both halves of the engine; a read only touches the LSM half when the cache has nothing for it:
a is a hit on its second read — the write-through cache already had it.
b is a miss the first time (nothing's been written yet), then a hit once
it's written. c is a miss from start to finish: it was never written in
this trace, so there's nothing anywhere to find. Only the misses would ever
reach probe_count_bloom in the real engine; every hit is answered entirely
out of the cache dict, no disk probe at all.