Databases · Cluster
Storage Engines
Buffer pools, pages, and write amplification.
- 01 Slotted Pages: Fitting Variable-Length Records into Fixed-Size Blocks Why a page keeps its records at the end and its directory at the front, how item identifiers decouple record addresses from byte offsets, and where the free space goes.
- 02 Buffer Pool Frames, Pin Counts, and Replacement Under Pin Pressure How a page identifier is mapped to a frame of memory, why a pin is not a lock, what happens when every candidate for eviction is pinned, and how clock sweeps approximate LRU.
- 03 Write-Ahead Log Record Ordering and the Force-at-Commit Boundary Why a log record must reach stable storage before the page it describes, what LSN comparison guarantees during recovery, and where group commit fits in the sequence.
- 04 Page Splits and the Write Cost of a Single B-Tree Insert What an insert actually writes when a leaf page has no room, why the split propagates to the root, and how fill factor and right-links change the count.
- 05 LSM Compaction: Size-Tiered and Leveled Strategies Compared How an LSM tree turns random writes into sequential ones, what each compaction strategy costs in read amplification and space amplification, and when the write stalls arrive.
- 06 Doublewrite Buffers and the Torn Page Problem Why a page write is not atomic on real hardware, how a shadow copy restores the page after a partial write, and what the extra sequential write costs.
- 07 fsync, fdatasync, and Where the Durability Boundary Actually Sits What the kernel guarantees when a write returns, which metadata fdatasync skips, why direct I/O does not remove the need for a flush, and how double buffering wastes memory.
- 08 Page Compression: Prefix, Dictionary, and the Cost of Decoding How prefix truncation, shared dictionaries, and byte-level encoding shrink a page, why decompression sits on the critical path, and where compression defeats the buffer pool.
- 09 Latch Coupling and Deadlock Avoidance in the Buffer Pool Why latches are not locks, how lock coupling keeps a B-tree descent deadlock-free, what a partitioned buffer pool hash table buys, and where contention concentrates.
- 10 Write Amplification Across the Storage Stack How one logical row change becomes many device writes, how to attribute the multiplier to each layer, and which layer dominates for B-trees and LSM trees.