Every database, no matter how it presents itself, eventually has to turn your rows into bytes on a disk and read them back. The component that owns that job is the storage engine, and it is the most load-bearing decision in the whole system: get it right and you understand why the database is fast or slow, why writes stall, why a range scan flies. This chapter builds the two dominant designs — the B-tree and the LSM-tree — from the page up.
The page (8 KB in Postgres, 16 KB by default in InnoDB, 4 KB by default in SQLite) is the engine's unit of I/O, caching, latching and recovery, all at once. Everything later in this chapter is a consequence of a mismatch in granularity: applications change rows of tens to hundreds of bytes, while the engine moves pages of thousands of bytes, and the flash underneath moves erase blocks of megabytes. Each boundary between those three sizes is an amplification factor, and the two engine families differ mainly in which boundary they choose to pay at.
The slotted layout is worth one look for what it buys, not how it works. Because an index points at page-id + slot rather than a byte offset, a row can grow, shrink or be compacted within its page without touching any index. That is the property that lets Postgres's heap-only-tuple updates skip index maintenance when the new version fits on the same page (the fillfactor knob exists to leave room for exactly that; the mechanics belong to Transactions, Isolation & MVCC). It also means a row that no longer fits must move, and the cost of that move (a forwarding pointer, a new index entry, or a page split) is where engines quietly diverge.
The page (a.k.a. block) is the atomic unit of I/O — the database reads and writes whole pages, never single rows. The slot directory lets rows be variable-length and move within the page without changing the row's identity (its slot number), which is why a row's address is page-id + slot, not a raw byte offset.
Page size is a real design lever, and the usual advice to "leave it at the default" hides the trade. Doubling the page size roughly doubles fan-out, which can remove a level from a very large tree, and it improves compression ratio and sequential scan efficiency. It also doubles the bytes written for every isolated row change at the left edge of the locality curve in 1.2, doubles the bytes read for every cache-missing point lookup, and widens the latch footprint, so more concurrent writers collide on the same page. Illustrative: a 120-byte row update costs a 16 KB page write on InnoDB's default versus 8 KB on Postgres. At 10k isolated updates/s that is 160 MB/s versus 80 MB/s of page write-back before the WAL. That is why InnoDB page compression and smaller innodb_page_size settings exist, and why the right page size for a point-update OLTP store and for a scan-heavy reporting store differ.
Two lower boundaries matter more than most reviews admit. First, the engine page is rarely the same size as the device's atomic write unit, so a crash can tear a page in half. Engines pay for that with full-page images in the log or a doublewrite buffer, which is another write-amplification term (see The WAL & Durability). Second, flash cannot overwrite in place: the SSD's translation layer (FTL) writes every page somewhere new and garbage-collects erase blocks later, adding its own device-level write amplification underneath the engine's. Section 1.8 multiplies the two together, because that product, not the engine's own number, is what wears out drives.
The B+tree's appeal is the bound on reads: with fan-out in the hundreds, the tree is only a few levels deep at any size that matters, every leaf sits at the same depth, and sibling-linked leaves turn a range scan into one descent plus a sequential walk. What senior engineers need from it is less the structure than the conditions under which those guarantees hold, because each one depends on something outside the tree: the buffer pool, the key distribution, and the concurrency pattern.
Every leaf sits at the same depth, so every lookup costs the same — O(log n) page reads. Because fan-out is high (hundreds of keys per page), even a billion rows is only ~4 levels deep. The dashed links between leaves are what make range scans cheap: find the start, then walk siblings sequentially.
The price is on the write side. An update-in-place engine converts a small logical change into a whole-page write-back, a full page into a split that dirties the parent too, and random keys into writes scattered across the whole file. None of that is news. What matters is that each cost is nonlinear in something the application controls.
Two precisions a design review should insist on. First, "Postgres is a B-tree database" is only half true: InnoDB and SQLite store the table itself in a B+tree keyed by the primary key (a clustered layout), while Postgres keeps rows in an unordered heap and uses B-trees only for indexes — its update path is new-tuple-versions-plus-index-maintenance, covered in Transactions, Isolation & MVCC. Second, the depth argument is really a memory argument. With fan-out in the hundreds, the internal levels are well under 1% of the leaf level (illustrative: 1 TB of 8 KB leaves at fan-out 400 needs only a few GB of internal pages), so they stay pinned in the buffer pool and a random point read costs one physical I/O, not four. The moment internal pages start getting evicted, that promise quietly becomes two or three I/Os per lookup.
The classic production failure is a random primary key on a clustered B-tree — UUIDv4 on InnoDB is the canonical case. While the index fits in the buffer pool, nobody notices. Once it outgrows RAM, each insert lands on an effectively random leaf that must be read in first, and splits leave pages roughly half full (InnoDB splits in the middle for non-sequential inserts, versus filling pages nearly full on sequential ones), so the same data needs noticeably more pages, which pushes the index further past memory. Insert throughput does not degrade gracefully; it falls off a cliff where the working set crosses the buffer pool, and the graph looks like a hardware problem. The fix is in the key (time-ordered IDs such as UUIDv7, or a sequence plus a separate public ID), not in the engine. Write amplification on a B-tree is therefore not a constant; it is a function of how many changes land on a page before that page is written back:
The left edge is the B-tree's worst case: every 120-byte change dirties an 8 KB page that is evicted before a second change lands on it — ~68× page write plus the log. Move right (hot pages, bigger buffer pool, longer checkpoint interval, monotonic keys) and the same engine drops below 5×. The LSM's cost barely depends on locality; it depends on level count and fan-out. The crossover — not the engine's reputation — decides which one writes less for your key distribution.
Worked example (illustrative): 20k random single-row updates/s, 120-byte rows, 8 KB pages, data 10× the buffer pool. Almost every update dirties a distinct page, so steady-state write-back approaches 20k × 8 KB ≈ 160 MB/s of random page writes to change ~2.4 MB/s of data. The same rate against a 2 GB hot table that fits in memory might flush each page once per checkpoint after absorbing hundreds of changes — two orders of magnitude less I/O from the same engine. Before you blame the engine, ask where your updates sit on that curve.
The random-key cliff deserves its own arithmetic, because it is the most common way a healthy B-tree becomes an incident. Two effects compound. First, random insertion leaves leaves about 69% full on average (the classic ln 2 result for random B-tree insertion), while sequential insertion packs them close to full (InnoDB leaves about 1/16 of each page free). The same rows therefore need roughly 1.3–1.4× more pages with a random key, so the index crosses the buffer pool noticeably earlier in the table's life. Second, once it crosses, the probability that the target leaf is resident falls toward BP ÷ index size, and every miss is a synchronous random read on the insert's critical path, before any write happens:
Shape from a simple residency model, not a benchmark. Real curves are smoother near 1× because of access skew, but the step is real. Throughput is bought back only with concurrency and IOPS. Also note that the random-key index reaches the edge sooner than a sequential one holding the same rows, because its leaves are emptier.
Worked through (illustrative): a 600 GB UUIDv4-keyed InnoDB table with a 96 GB buffer pool. Leaf residency is at best ~16%, so ~0.84 random reads per insert. If an insert costs ~15 µs of CPU and log work when everything is cached and a device read adds ~100 µs, a single connection drops from ~65k inserts/s to ~10k, and the system needs 6–7× the concurrency, and the device IOPS to match, to hold the old rate. The same table keyed by a time-ordered ID keeps its hot right edge in a few hundred MB of cache indefinitely. This is why "just use UUIDs" is harmless advice at 50 GB and a capacity incident at 500 GB, and why the incident arrives as a step change, not a trend.
Here the conventional advice is wrong in the other direction. "Always use sequential keys" moves every insert onto one page, the rightmost leaf, and at high concurrency that page's exclusive latch becomes the bottleneck: throughput plateaus while CPU sits idle and the wait profile fills with page-latch waits. SQL Server added a dedicated index option (OPTIMIZE_FOR_SEQUENTIAL_KEY) for exactly this last-page insert contention, and Postgres special-cases insertion into the rightmost leaf to shorten the latched path. The engineering answer lies between the extremes: keys that are time-ordered at coarse granularity but spread at fine granularity (a small shard or bucket prefix, or UUIDv7's random tail within a millisecond) keep the working set small without funneling every writer through one latch. The threshold where this matters is concurrency, not volume. A few hundred inserts/s on one right edge is invisible, while tens of thousands per second from hundreds of connections is not.
The LSM makes the opposite bet. It never reads before writing and never overwrites. A write is a memtable insert plus a WAL append, a full memtable is flushed as an immutable sorted SSTable, updates are newer entries, and deletes are tombstones. The real design choice is not "LSM" but how the sorted runs are organized: leveled (RocksDB's default, Cassandra's LCS), tiered (Cassandra's long-time default STCS, RocksDB's universal), or time-windowed. The 10×-per-level pyramid below is the leveled shape and should not be assumed for every LSM.
write(k,v)
WAL append
durable, sequential
Memtable
sorted map in RAM
flush → SSTable
immutable, sorted
On-disk levels (leveled compaction) — each ~10× the last, merged downward
No write ever seeks to overwrite an old value. An update or delete is just a newer entry (a delete writes a tombstone). The memtable absorbs writes at memory speed; when it fills it is frozen and flushed as one immutable, sorted SSTable. This is why LSM engines sustain enormous write rates — every write is sequential.
Three consequences of "no read before write" are underrated. First, blind writes are nearly free, but anything that does need the old value (a uniqueness check, a secondary-index update that must delete the old entry, a read-modify-write counter) reintroduces the random read the design was meant to avoid, so an LSM-backed table with several unique secondary indexes can lose most of its write advantage. That is one reason merge operators and blind-write index designs exist. Second, the memtable is a latency buffer, not a throughput one. It absorbs bursts only up to its size, and after that the sustained rate is set entirely by flush and compaction bandwidth. Third, memtable and WAL sizing set recovery time: a crash replays the WAL for every unflushed memtable, so gigabytes of write buffer across many column families translate directly into restart time, which is a cost that only appears during an incident.
The sizing arithmetic (illustrative): at 100 MB/s ingest with 256 MB memtables, a flush happens every ~2.5 s. With the RocksDB default L0 compaction trigger of 4 files, L0→L1 compaction must start roughly every 10 s and must merge those files with the overlapping part of L1, which can be several times their size. If L1 is sized at 1 GB, each L0→L1 compaction rewrites up to ~2 GB to absorb 1 GB of new data, so this one step needs ~200 MB/s of sustained read and write bandwidth before any deeper level is considered. Larger memtables reduce flush frequency but raise recovery time and L0 overlap. The knob does not remove the cost, it only chooses where you pay it.
A point lookup checks sorted runs newest-first. A lookup for an absent key is the worst case, because it must rule out every run. Per-file bloom filters and block indexes make that bounded, but the bound is not free. It is paid in memory, and it depends on how many sorted runs exist at that moment, which compaction debt can change within minutes.
This is read amplification: a single point read may probe the memtable plus several SSTables because the newest version wins and could be anywhere. Two structures rescue it — a per-SSTable bloom filter that answers "definitely not here" without any disk I/O, and a block index that jumps straight to the right block. Without bloom filters, LSM point reads would be unusable; range scans get no help from them at all.
The number that matters is expected wasted I/Os per lookup = Σ over runs of the false-positive rate. In a leveled tree with 4 L0 files and 5 levels (9 runs) at 10 bits/key, an absent-key lookup wastes ~9 × 0.8% ≈ 0.07 I/Os, which is excellent. Let L0 back up to 20 files during a burst and that becomes ~25 runs and ~0.2 I/Os, while every probe also spends CPU on 25 filter checks and 25 index-block binary searches. That is why read p99 degrades during write bursts on an LSM even though no read touched more data. Research on LSM tuning (Monkey, for one) shows the memory is best spent unevenly, with more bits per key on the small, recent levels and fewer on the huge last level, because a false positive costs the same I/O at every level while the last level holds most of the keys.
Standard bloom math (FP ≈ 0.6185bits/key at the optimal hash count). RAM is linear and the benefit is geometric, so past ~10–12 bits the next gigabyte usually buys more as block cache than as filter. The right-hand column is the one that surprises teams: the same filters cost nearly 3× more wasted I/O when compaction falls behind. Newer filter formats (RocksDB's Ribbon filter, for example) trade CPU for a smaller footprint at the same FP rate.
The bloom arithmetic is worth doing once. At ~10 bits per key a bloom filter gives roughly a 1% false-positive rate; each extra ~5 bits cuts it by about another order of magnitude. For 2 billion keys that is ~2.5 GB of filter at 10 bits/key — memory that competes with the block cache, and that many teams discover only when filters start being evicted and point-read p99 jumps with no change in traffic. The usual tuning moves: pin filters and index blocks in cache, and skip filters on the last level (most keys that exist live there, so the filter mostly confirms what the probe would find anyway), trading a slightly worse miss path for a large memory saving.
The conventional line — "bloom filters make LSM reads fine" — is true only for point reads of keys you can name. Bloom filters answer "is key k here?"; they say nothing about "what is in [a, b)?". A range scan must open an iterator on the memtable and on every overlapping SSTable in every level and run a heap merge across them, so its cost scales with the number of sorted runs, not the number of rows returned (prefix blooms help only when the range shares a fixed key prefix). Worse, a scan must step over every tombstone in the range: a queue-like table where consumers delete from the head leaves a growing carpet of tombstones that each "fetch next 100" has to walk before it finds a live row. Cassandra warns on this by default when a read crosses 1,000 tombstones and aborts it at 100,000. Queue-on-LSM is a known antipattern for exactly this reason.
Even so, LSM reads are fundamentally more work than B-tree reads, and read amplification grows as SSTables accumulate. Which is exactly why the background process that keeps their number down — compaction — is not optional housekeeping but a core part of the design.
Compaction is the LSM's garbage collector and its read-path optimizer at once. It merges sorted runs, keeps the newest version of each key, and drops shadowed values and expired tombstones. The merge itself is cheap, a linear pass over sorted inputs. What is expensive is how many times each byte gets merged on its way to the last level, and that is set by the compaction policy, not the engine.
Input SSTables (overlapping)
file A (newer)
a=2 c=9 d=⌦(del)
file B (older)
a=1 b=5 d=7
Merged output
a=2 (A wins over a=1)
b=5 (only in B)
c=9 (only in A)
d dropped (tombstone GCs d=7)
Because inputs are already sorted, compaction is a linear merge. It reclaims space (shadowed and deleted keys vanish) and restores read performance (fewer files to probe). But it re-reads and re-writes data that was already on disk — that rewriting is write amplification, and it competes with live traffic for disk bandwidth, which is why compaction tuning is the defining operational chore of an LSM store.
The two classic policies differ in one decision: whether a new run is merged into an existing big run immediately (leveled) or waits until several peers of similar size exist (tiered). The diagram follows one byte through each. Leveled rewrites it about once per level for every level it crosses, multiplied by the fan-out because each Ln file overlaps about ten Ln+1 files. Tiered rewrites it roughly once per tier, but leaves several overlapping runs per tier for reads to probe and needs headroom for the biggest merge.
Leveled (fan-out T = 10)
WAL
1×
flush → L0
1×
L0 → L1
≈ 1–2×
L1 → L2
up to ~T
L2 → L3
up to ~T
L3 → L4
up to ~T
write amp
≈ 10–30× measured
runs a read probes
L0 files + 1 per level
space amp
≈ 1.1× steady
Tiered (T runs merged per tier)
WAL
1×
flush → tier 0
1×
tier 0 → 1
1×
tier 1 → 2
1×
tier 2 → 3
1×
tier 3 → 4
1×
write amp
≈ 4–8×
runs a read probes
up to T−1 per tier
space amp
up to ~2× during big merge
Illustrative orders of magnitude, not measurements. Leveled's per-level cost is "up to T" because an Ln file overlaps about T files below it, and real trees land well under the worst case. Hybrids exist for this reason: tiered on the small upper levels and leveled on the last one gets most of tiered's write savings and most of leveled's space efficiency.
A third policy is the one most TTL-heavy systems actually need, and it is often missing from the design discussion: time-windowed compaction (Cassandra's TWCS, RocksDB's FIFO style). If rows are written in time order and expire together, compact only within a window and drop whole files when the window expires. There are no tombstones to scan and no rewrite of cold data, and write amplification after the window closes approaches 1×. It breaks, badly, the moment writes arrive out of window (late backfills, clock-skewed producers, or an update to an old row), because a single late write pins an old file and its whole window until the newest row in it expires. Decision rule: if more than a small fraction of writes (illustratively, over a few percent) land outside the current window, or if rows receive explicit deletes rather than TTLs, time-windowing turns into space amplification instead of saving work.
The operational catch is that compaction competes with live traffic for the same disk and CPU. Under a write-heavy burst, compaction can fall behind, SSTables pile up, read amplification climbs, and you get the notorious LSM latency spikes. Tuning compaction — its strategy, its bandwidth budget, its trigger thresholds — is the single most important knob on an LSM store, exactly as buffer-pool sizing is on a B-tree store.
Do the capacity math before the burst does it for you. Leveled write amplification is roughly: 1 for the WAL, 1 for the flush, plus up to about the fan-out for each level a byte is merged into — so with fan-out 10 and four or five levels, 10–30× is a normal planning range (illustrative; measure yours from the engine's compaction stats). At 50 MB/s of logical ingest and 20× WA the device absorbs ~1 GB/s of writes — about 86 TB/day. On a 7.68 TB drive that is on the order of 11 full drive writes per day, against endurance ratings that for many read-oriented enterprise SSDs sit around 1 DWPD. The engine will run fine in the load test and eat the fleet's SSDs in months. Size-tiered cuts WA substantially but charges it in space: a full merge of the largest tier temporarily needs space for inputs and output at once, which is why the long-standing operator guidance for size-tiered Cassandra tables is to keep up to half the disk free.
When compaction falls behind, the engine does not fail — it applies admission control, and the way that unfolds is what pages you at 3 a.m.:
Shape, not measurement. The lag between cause and symptom is the trap: the burst starts at the second column, but nothing user-visible happens until L0 crosses the slowdown trigger minutes later — by which time the backlog (pending compaction bytes) is already large. Stalls are the engine protecting read amplification; raising the triggers just moves the pain from writes to reads.
The second-order effect is the dangerous one: stalled writes become client timeouts, clients retry, and the retries re-offer load to an engine that is throttling precisely because it cannot keep up — a metastable loop that can outlast the original burst. Alert on the leading indicators (L0 file count trending toward the slowdown trigger, pending compaction bytes, compaction throughput versus flush throughput), not on write latency, which moves last.
Deletes carry their own trap in replicated LSM stores. A tombstone must survive long enough to reach every replica; Cassandra keeps it for gc_grace_seconds (ten days by default) before compaction may purge it. If a replica is down longer than that and returns without a full repair, compaction on the healthy replicas has already dropped the tombstone, and the stale replica's old value is served — and re-replicated — as live data: zombie resurrection. The design-review question for any TTL- or delete-heavy LSM table is therefore operational, not structural: what is the repair cadence, and is it provably shorter than the tombstone grace period?
Read, write and space amplification form the standard comparison, and the RUM conjecture from database research formalizes the intuition that an access method cannot be optimal on all three at once. The useful discipline in a review is to insist that each number be stated with its conditions: read amp for which operation (a hit, an absent key, a 100-row range), write amp at which locality, and space amp at steady state or at peak during a merge. Most engine arguments that go nowhere are two people quoting different cells of that matrix.
One place the folklore is wrong: "LSMs waste space, B-trees are compact." A B-tree under random inserts runs with leaves somewhere between half and fully packed, plus free space left by deletes that only a rebuild reclaims — a space amplification of 1.3–1.5× is unremarkable (illustrative). Leveled compaction, by contrast, keeps nearly all data in the last level and pays only for the obsolete versions sitting in the smaller levels above it; with the level sizes tuned so the last level dominates, the RocksDB team's own analysis puts steady-state space amplification near 1.1×, and block compression works better on large immutable files than on 8–16 KB update-in-place pages. That is why several large operators moved B-tree-backed MySQL data onto RocksDB-based storage (MyRocks) primarily to save disk and flash wear, not for write speed. It is the size-tiered LSM that earns the space-hungry reputation.
Rough, illustrative shapes, not benchmarks. The B-tree reads well (a lookup is a handful of page reads) but writes hard (a single-row update dirties and eventually rewrites a whole page). The LSM writes beautifully (all sequential) but pays it back in read and compaction work. There is no free lunch — only a choice about which amplification your workload can afford. The space bars assume size-tiered compaction and a freshly built B-tree; under leveled compaction and a randomly-inserted B-tree the space ordering flips (see below), and B-tree write amp moves along the locality curve in 1.2.
The amplification that gets priced least is CPU. LSM compaction decompresses, merges, recompresses and checksums every byte it rewrites, so at 20× write amp a node ingesting 50 MB/s is running a continuous ~1 GB/s decompress-merge-compress pipeline on background threads. On cloud instances where storage is fast and cores are the metered resource, that background CPU, not I/O, is often what sets the node count. The question to ask is not "which engine is faster" but "which amplification can this workload afford, on which resource, at what data size".
"B-tree versus LSM" is a teaching simplification. What actually separates designs is a small set of independent choices: whether a page or record is updated in place or written out of place, whether the index is one sorted structure or many sorted runs, and whether values travel with keys during reorganization. Real engines pick different answers on each axis, and knowing which ones a given database picked predicts its behavior better than its family label does.
Blue marks the classic B-tree answer on an axis, green the classic LSM answer, and gold or pink a hybrid. Every row mixes colors except the first and the fifth, which is the point: the family name tells you less than the three choices do. The last column is where each design's incidents come from.
Three hybrids come up in reviews often enough to know cold. Copy-on-write B-trees (LMDB, and the pattern behind several embedded stores) never overwrite a page. They write a new path from leaf to root and swap the root atomically. Reads are lock-free and crash consistency comes almost for free, but every commit rewrites a full root-to-leaf path, and a single-writer design caps write concurrency. Out-of-place B-trees (WiredTiger, MongoDB's default engine) keep a B-tree in memory, reconcile dirty pages into new on-disk images at checkpoint, and never overwrite live blocks. Write behavior then depends on checkpoint cadence and cache eviction pressure more than on the tree shape, which is why WiredTiger incidents look like cache-eviction problems rather than page-split problems. Key-value separation (the WiscKey design, RocksDB's BlobDB, TiKV's Titan) keeps only keys and pointers in the LSM and appends values to a separate log, so compaction moves small entries instead of whole values.
KV separation is where a quantitative threshold helps most. Compaction write amp applies to the bytes compaction moves. With 4 KB values and 32-byte keys plus pointers, separating values cuts those bytes by more than 90%, so compaction write amp on the total data drops from ~20× to low single digits plus the value log's own garbage collection. With 100-byte values the saving is marginal, and the cost remains: every range scan becomes a random read into the value log per row, and deleting values requires a second GC process with its own space amplification. Rule of thumb (illustrative): consider separation when values are consistently above ~1 KB, the workload is point-read or write dominated, and range scans over values are rare. Below a few hundred bytes, or for scan-heavy access, it usually loses.
The practical consequence for architecture reviews: when a team says "we chose X because it's an LSM", ask which compaction policy, whether values are separated, and what the memtable and cache budgets are. Two RocksDB deployments with different settings can differ by an order of magnitude in write amp and read p99, much more than a well-tuned RocksDB differs from a well-tuned InnoDB on the same workload.
Flash adds its own amplification underneath the engine. An SSD cannot overwrite a page in place. The FTL writes each logical page to a fresh physical location and later garbage-collects erase blocks, copying still-valid pages forward. How much copying that takes depends on the write pattern and on how much free space the drive has to work with. Large, sequential, whole-file writes that are later deleted and TRIMmed, which is the LSM's pattern, leave erase blocks almost entirely invalid when GC reaches them, so device write amp stays near 1×. Small random in-place overwrites spread across a nearly full drive, which is the B-tree's left-edge pattern, leave erase blocks with mixed live and dead pages, and device write amp can reach several × (illustrative; it depends heavily on over-provisioning).
The engine that writes fewer bytes is not necessarily the one that wears fewer cells. Device WA is measurable: compare the drive's NAND-write counter with its host-write counter over a day of real load before believing any row of this chart for your fleet.
The consequence reverses a lot of folklore. Engine-level comparisons ("LSM writes 20×, B-tree writes 10×") are incomplete. What hits NAND is ingest × engine WA × device WA, and the device term favors sequential, file-granular writers. A random-update B-tree at 10× engine WA on a drive at 85% full may put more bytes on NAND than a leveled LSM at 20× with device WA near 1. Conversely, an LSM on a drive without working TRIM, or sharing the drive with a random-write workload, loses its device-level advantage. Levers in order of cost: leave real free space (over-provisioning is the cheapest endurance multiplier there is), make sure discard/TRIM actually reaches the device through every layer (filesystem, LVM, cloud block device), and measure device WA from SMART host-writes versus NAND-writes counters instead of assuming it.
Cloud block storage changes the arithmetic in a different way. On network-attached volumes you do not pay for NAND wear, but you pay in provisioned IOPS and throughput caps, and a compaction burst or dirty-page flush storm that saturates the volume's throughput limit stalls the foreground WAL write sharing the same cap. The capacity question becomes: does ingest × engine WA, plus compaction or checkpoint reads, fit under the volume's sustained throughput with room for the WAL? Teams that size to the average and not to the compaction peak find out during their first backfill.
The textbook summary (B-tree for read-heavy OLTP, LSM for write-heavy ingest) hides the signals that actually decide it, and several of them point opposite to intuition. A "write-heavy" workload with monotonic keys is often cheaper on a B-tree than on an LSM, because appends coalesce into the rightmost leaf; an "OLTP" workload whose index is ten times RAM with random keys may be better served by an LSM precisely because it cannot afford random reads-before-writes.
Thresholds are rules of thumb for starting a conversation, not constants. Note the row most teams skip: ingest × write amp against the device's sustained write bandwidth and endurance rating — the one that decides whether an LSM survives its second year in production.
Engine migrations deserve a warning of their own, because the benchmark that justified one rarely tests what breaks. Moving a table from InnoDB to an LSM-backed engine to save space and flash (the MyRocks pattern) changes more than the storage format. Reverse range scans, uniqueness checks and locking behavior have different costs, and the operational runbook moves from buffer-pool and purge tuning to compaction and cache budgeting. Moving the other way to fix LSM read tails can reintroduce the random-key cliff if the key was never time-ordered. Budget the migration as a new failure-mode inventory, not a drop-in swap: replay production traffic at projected data size, since both engines look similar while everything fits in memory.
The payoff is diagnostic. A B-tree that slows under write load points at dirty-page flushing, splits, buffer-pool residency or a hot right-edge latch. An LSM with latency spikes points at run count, compaction debt, filter or block-cache eviction, or tombstone density. Knowing which design choices sit under a database tells you where to look before you open a dashboard.
Questions to ask in the design review
Page
Unit of I/O
B-tree
Read-optimized
LSM
Write-optimized
Amplify
R · W · space
Where next