Articles
Notes on backend architecture, performance work, and the WordPress and Laravel systems I build.
14 min readOne product page, 201 queries: fixing N+1 and making it visible in review
The N+1 query problem, answered end to end — why 201 fast queries add up to 9 seconds while the slow log stays empty, the fix ladder from eager loading to batch loaders and counter caches, the traps (cartesian joins, per-parent limits, huge IN lists), and how to turn query count from a runtime accident into something CI fails on.
Intermediate- Databases
- Performance
- Laravel
- ORM
17 min read800 million requests, one corrupted row: debugging what you cannot reproduce
A senior backend interview question, answered as an investigation. Why "1 in 800 million" and "cannot reproduce" are themselves evidence, how to read the shape of the corruption, how to reconstruct the timeline from binlog and WAL, how to turn one bad row into a population you can query — and how to make the whole bug class impossible afterwards.
Advanced- Debugging
- Concurrency
- Databases
- Reliability
16 min readSELECT COUNT(*) is slow on 30M rows: how to make counting fast at scale
Why COUNT(*) degrades on a 30M-row table under MVCC, and the full ladder of fixes — keyset pagination, planner estimates, capped counts, covering indexes, sharded summary counters, rollup tables and OLAP replicas — with the MySQL and PostgreSQL code for each and a table for picking the right one.
Intermediate- Databases
- Performance
- MySQL
- PostgreSQL
15 min readMillions of rows nobody uses: how to delete them without breaking production
You found a table with millions of rows and no obvious owner. This is the playbook: prove nothing reads it, make every step reversible before any step is destructive, then delete in batches your replicas can survive — with the MySQL and PostgreSQL queries that produce the evidence.
Intermediate- Databases
- MySQL
- PostgreSQL
- Operations