← bruni.world
BRUNI · FIELD NOTES
It Worked
in Dev
It passed every test. Then production traffic arrived, and it fell over —
without a single line of code changing. This book collects exactly those moments: 85 of them.
85 failures~180 pagesPDF · A5Databases · Backend
No textbook chapters. "What is an index" is a search away.
This book only covers incidents where the code had no bug and
outages assembled from perfectly reasonable settings.
Every failure, in 7 parts
All 85 follow the same structure — put the book down anywhere and you'll know exactly where you left off.
- Symptom — the scene, as you'd actually meet it
- Why — the mechanism underneath
- Code — the broken version and the fixed one
- In production — real numbers, the worse cases, the easy misses
- The fix — what to change, concretely
- Check yours — queries and commands to run against your own system
- One line to keep
A taste
One long transaction bloats the whole database
Symptom — Disk usage keeps climbing. No new data, but tables keep
growing — and autovacuum runs constantly without reclaiming anything.
In production — One idle six-hour transaction once bloated a
1M-row table to 50GB. 49GB of it was dead rows nothing could remove. And because
the snapshot is database-wide, every table bloats together.
# both default to 0 (unlimited)
idle_in_transaction_session_timeout = '5min'
statement_timeout = '30s'
One line — a transaction left open ties the janitor's hands.
Contents
Part 1 Databases — Fundamentals19
Part 1 — Transactions12
Part 1 — Indexes & Query Plans12
Part 2 Backend — Foundations18
Part 2 — Traffic12
Part 2 — Observability & Deploys12
Who it's for
Backend engineers whose service is starting to grow, juniors who just
got put on-call, and anyone preparing for the interview question
"tell me about an incident you handled."
Not for first-time database learners — it skips the basics
and walks straight into the incident.