Watch a query move through PostgreSQL, MySQL, MongoDB, Redis and Cassandra, step by step, with numbers measured on real servers. Then put it to work: pick the right database, design the tables, and fix it when it breaks.
I run production databases for a living. This is the site I wanted when I started.
Three questions, new every day. Every answer comes from a real measurement or a lesson on this site, and links to it.
Loading today's questions…
One missing index: 19,231 pages to find one row
A network split: Cassandra keeps both writes, then loses one
The dual write bug: the order saved, the event lost
Random UUIDs: why MySQL inserts got 10 times slower
Questions from the lessons you have read come back after a day, then three, then a week, so they stick. Kept in this browser only.
Four parts, each answering one question. The menu at the top has every page in them.
From one row on disk to transactions: the words you need, PostgreSQL, MySQL and MongoDB from the files up, then Redis, Cassandra and vector search, side by side, and the query and concurrency traps.
and 17 more →Start with The course →Simulations, an index you build yourself, a real PostgreSQL in your browser, experiments run on real servers, and tools for your own database: a query coach, an EXPLAIN reader, a config checker and a health check.
and 3 more →Start with The daily →What kind of application data goes in which database, and why, as design docs, plus the anti-patterns and the decisions behind them.
What to check when it is slow or broken, where it runs and what it costs, how big it must be, pooling, backups, security, upgrades and other changes made safely.
Not sure where to begin? Pick the path for your goal, or open your map of every lesson, with the ones you have read ticked.
Best when correctness matters most.
One data directory. Each table and each index is its own file of 8 KB pages. Updates write a brand-new row version; VACUUM cleans the old ones.
Log: WAL in pg_wal/ · Data: base/<db>/<file> · Memory: shared_buffersBest for fast websites where most lookups are by ID.
Each table is one .ibd file that is the primary-key index. Rows are stored in ID order, 16 KB pages. Two logs: redo for crashes, binlog for copies.
Best when every record looks a bit different.
Documents instead of rows. Each collection and index is its own compressed .wt file. Copies follow the oplog, a special collection in the local database.
The same write, crash and replica in each engine, side by side: Engines side by side →
Uber, Notion, Adyen, Figma, Dropbox, GitHub, Slack, Shopify, Epic Games, GitLab, and Instacart. Each story has the numbers, the fix, and the lesson I took from it. Read the stories →