Database internals in production

From the B+ tree up: why indexes get ignored, what fsync actually costs, how isolation levels lie to you, and the schema decisions that only hurt at scale.

Read in order: later instalments assume the earlier ones. 2 more instalments in the publish queue.

  1. 01 Why UUID Primary Keys Quietly Destroy Database Performance
  2. 02 Why your index is not being used, and why the planner is usually right
  3. 03 Covering indexes: the cheap 10x that most schemas leave on the table
  4. 04 The RUM Conjecture: You Cannot Optimize Reads, Updates, and Memory at Once
  5. 05 LSM compaction is a background job that will wake you at 3am
  6. 06 fsync is the only thing between you and data loss, and it is slower than you think
  7. 07 Decoding isolation levels: I built a toy DB to force dirty reads and phantom reads
  8. 08 ADD COLUMN is not always free, and the lock queue is what takes you down
  9. 09 Foreign keys are not overhead, and the thing you measured was a missing index
  10. 10 Your JSONB column became the schemaless disaster you migrated away from
  11. 11 Soft deletes are a schema decision that breaks every query you write afterwards
  12. 12 Your ORM issued 400 queries and the p99 looked fine until it didn't
  13. 13 One round trip beats a thousand, and your batch API probably is not batching
  14. 14 Pagination at Scale: Why OFFSET and SKIP Will Eventually Break Your API
  15. 15 The replica lag you do not measure is the one serving checkout
  16. 16 Connection pool sizing is a queueing theory problem, not a tuning knob
TTFB: -- ms LOAD: -- s PAYLOAD: -- kb