0 day streak
8. DatabasesStorage engines

Storage engines

A storage engine is the part of a database that decides how data is physically laid out on disk and how it’s read back. One big split is B-trees versus LSM trees: a B-tree keeps data in sorted pages and updates them in place, which suits read-heavy workloads, while an LSM tree buffers writes in memory, flushes them as sorted files and merges those files in the background, which makes writes very fast at some cost to reads. The other split is row versus column layout: row stores keep each record together, ideal for fetching or updating individual rows, while column stores keep each column together, ideal for analytics that scan a few columns across millions of rows.

In this lesson: B-tree vs LSM on the same workload, and a 3D row vs columnar block layout.