The Runtime Theory
DatabasesIn production

Storage Engines: LSM-Trees vs. B-Trees

Recording in progress
#storage-engines#lsm-tree#b-tree#compaction

The engine is the database. We compare the two dominant storage engines on the operations that matter: how a B-tree writes in place with page-level locking, and how an LSM-tree appends to memtable and log, then flushes and compacts. We visualize write amplification, read amplification, and space amplification for both. Then we map the trade-off to real workloads: why OLTP databases default to B-trees, why time-series and event stores choose LSM, and where the middle ground — read-optimized LSM tuning — lives. You leave able to look at a write pattern and predict which engine will suffer less.

Topics covered:

  • B-tree in-place writes and page splitting
  • LSM memtable, WAL, flush, and compaction
  • Write, read, and space amplification compared
  • Which engine fits which workload

Related articles

More in Databases

12:39
databases

B-Trees: The Shape of Databases

Why every major database is a tree shaped like a disk page — and how to read your index's health from its shape.

Watch
In production
databases

Postgres Internals Tour: Processes, Buffer Pool, WAL, and MVCC

A guided tour of PostgreSQL internals — process model, buffer manager, WAL, and MVCC — the mechanisms that make Postgres behave the way it does.

Details
In production
databases

SQL Joins and Execution Plans: Nested Loop, Hash, and Merge

How the database executes joins — nested loop, hash join, and merge join — and how to read execution plans to see which strategy your query gets.

Details
In production
databases

Connection Pools, Database-Side: What a Connection Really Costs

What actually happens to your database when connections pile up — the connection lifecycle, pool sizing math, and why max_connections is not a tuning knob.

Details
In production
databases

Sharding Strategies: Partition Keys, Distribution, and Rebalancing

How sharding actually works — partition keys, data placement, cross-shard queries, and the operational reality of splitting one database into many.

Details
In production
databases

Replication Explained: WAL Shipping, Lag, and Failover

How database replication actually works — the transaction log, the lag, and the failure modes of synchronous and asynchronous replication in production.

Details
In production
databases

Transactions and Isolation Levels: ACID, MVCC, and Anomalies

What transactions actually guarantee — ACID mechanics, MVCC, and the real behavior behind each isolation level, demonstrated with concrete anomalies.

Details
In production
databases

Database Indexes Visualized: B-Trees, Covering Indexes, and Planner Decisions

How database indexes actually work — B-trees, hash indexes, covering indexes, and when the planner will or won't use the index you made.

Details
In production
databases

Query Optimizer Internals: From Parse Tree to Execution Plan

What happens inside a query optimizer — parse, rewrite, join ordering, cost models, and how the planner decides the plan your query gets.

Details

Depth, delivered weekly

One technical dispatch a week — articles and episode notes before they go public.

One technical dispatch per week. No noise.