Honest Take — Before You Begin
Alex Petrov's Database Internals is hard. It is the kind of book where you read a chapter, understand maybe sixty percent, go for a walk, come back, reread it, and understand eigh…
Database Internals covers: Database Internals, Fundamentals of Database Systems. Understand how databases work at the storage engine level — B-trees, LSM-trees, write-ahead logs, buffer management, concurrency control, and recovery. This is where you stop being a database user and start understanding the database as a system.
Why adding an index speeds up reads but slows writes: every INSERT must update every B-tree index on the table. Why UUID primary keys cause B-tree fragmentation: B-trees store keys in sorted order, and UUIDs are random, causing page splits and wasted space (use uuid_generate_v7() for time-ordered UUIDs instead). Why VACUUM exists: PostgreSQL's MVCC creates a new tuple version for every UPDATE, and the old version becomes a "dead tuple" that must be reclaimed. Why idle_in_transaction connections are dangerous: they hold snapshots that prevent VACUUM from cleaning up dead tuples, causing table bloat. Understanding internals turns mysterious PostgreSQL behavior into logical consequences of design decisions.
This course unlocks once you've finished its prerequisite. Open prerequisite →
Alex Petrov's Database Internals is hard. It is the kind of book where you read a chapter, understand maybe sixty percent, go for a walk, come back, reread it, and understand eigh…
You have opinions about databases. Postgres over MySQL, B-tree indexes on the columns you filter by, UUIDs versus bigint primary keys, "don't leave transactions idle." Where did t…
Two requests hit your checkout endpoint at the same moment. Both read the account balance — 100. Both subtract 60. Both write. The balance is now 40, one of the debits has silentl…
Work through each item before the checkpoint.
1. Explain from memory how a SELECT query traverses from SQL text to result rows (parsing, planning, execution, buffer management, disk I/O) 2. Draw a B-tree of order 4 and show i…
5 lessons. Read in order; spiral back when you need to. By the end you'll have used the core ideas twice — once on the abstract, once on something you'll meet at work next week.