Writing
tags
Long-form notes on backend architecture, database performance, and the parts of shipping software nobody puts on a slide.
Databases
The N+1 Query You Ship Every Sprint
featured
Nine out of ten performance regressions I have diagnosed in production were the same bug wearing different clothes: an unloaded relation inside a loop that nobody noticed because the staging database has 40 rows.
Databases
Stop Using Publish Timestamps as Ordering Keys
Sorting by published_at looks correct until two posts share a timestamp, and then pagination starts silently duplicating and dropping rows.
Databases
Indexes Are Not Free and Your Write Path Knows It
Adding an index makes one read faster and every write slower. Most teams only ever measure the first half of that trade.
Sanitising Markdown Without Shipping a Sanitiser to the Browser
Where you sanitise matters more than what you sanitise with. Render once on write, store the result, and keep the sanitiser off the hot path.
Databases
Reading Your Own Query Plans
Stop guessing which query is slow. EXPLAIN ANALYZE with BUFFERS tells you what actually happened, and the answer is usually not what you assumed.
Backend
Caching Without Invalidation Regret
Most caching bugs are not cache misses. They are cache hits returning something that stopped being true an hour ago.