How shit works: Databases
summary
Most databases are built on one of two on‑disk structures and choosing between them is concrete not conceptual: B‑trees optimize reads and back indexes in Postgres/MySQL and many filesystems, with O(log n) lookups but read‑before‑write and write amplification on heavy inserts; LSM trees optimize writes via an in‑memory memtable, flushed to immutable SSTables and merged by compaction (Bloom filters reduce lookup IO). Practical choice order: operational capacity, access patterns (write‑heavy vs read‑heavy), then scale.
AI-written summary · about
chapters (12)
- 0:00Introduction to databases
- 1:51Choosing the right database
- 4:40What is a database
- 7:06Database problem domains
- 8:31Storing data on disk
- 11:23Durable storage systems
- 12:25B-trees explained
- 23:31When B-trees aren't ideal
- 29:13LSM trees introduction
- 36:39LSM tree compaction
- 42:40How to choose a database
- 49:06Q&A
related talks
45mThe Database: A Sophisticated and Special Data Structure
01h 16mDeep Dive into On-Disk Data Structures
35mQuestioning Database Claims: Design Patterns of Storage Engine
34mWhat We Talk About When We Talk About Disk IO
39mAn Introduction to B-trees and LSM-trees for DEVs and DevOps
01h 16mOn-Disk Data Structures: B-Trees, LSM-Trees and Fractal Trees
01h 16mHow do to do research with Systems Researchers
18mPreview: KV-Stores and Databases
