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. 1 more instalment 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 Deadlocks are a lock ordering bug, and lock ordering is a design decision
  9. 09 ADD COLUMN is not always free, and the lock queue is what takes you down
  10. 10 Foreign keys are not overhead, and the thing you measured was a missing index
  11. 11 Your JSONB column became the schemaless disaster you migrated away from
  12. 12 Soft deletes are a schema decision that breaks every query you write afterwards
  13. 13 Your ORM issued 400 queries and the p99 looked fine until it didn't
  14. 14 One round trip beats a thousand, and your batch API probably is not batching
  15. 15 Pagination at Scale: Why OFFSET and SKIP Will Eventually Break Your API
  16. 16 The replica lag you do not measure is the one serving checkout
  17. 17 Connection pool sizing is a queueing theory problem, not a tuning knob
TTFB: -- ms LOAD: -- s PAYLOAD: -- kb