Shopify
The Bundle That Sold Twelve Units the Store Did Not Have
A bundle is derived inventory, and derivation is not enforcement. Two concurrent orders both read the same component counts, both succeeded, and the store…
Query performance, deadlocks, N+1 patterns and data integrity problems across relational and non relational stores.
Shopify
A bundle is derived inventory, and derivation is not enforcement. Two concurrent orders both read the same component counts, both succeeded, and the store…
Error Autopsy
ERROR 40001 looks like a crash and feels like a bug. It is neither. It is the serializable isolation level doing its job, and the only correct client…
Security
The codebase was fully parameterised except one helper that interpolated a column name into an orderBy. That single string was the injection, and the ORM…
Bug Hunt
The finance team's export was short by a few rows and nobody knew by how many. The client library capped results at a thousand and raised no error, so the…
Performance
Every index is a second write. On an insert heavy table, nine well meaning indexes turned a fast append into a small transaction against ten data…
Code Review
A migration that is instant on a thousand row table can lock a production table for minutes at scale. Review for locking, backfill strategy and rollback…
Performance
After switching the pooler to transaction mode, the app started failing with 'prepared statement does not exist' at random.
PostgreSQL
Dead tuples that never get reclaimed, a table twice the size of its data, and queries getting slower every week. Here is what blocks vacuum and how to see it.
MicroVMs
Query times doubling at unpredictable hours with no deploy and no traffic spike. When the cause is not in your process, it is usually not on your machine…
Bug Hunt
The classic heisenbug. Here is why observation changed the outcome, and the three techniques that found it anyway.
PostgreSQL
Two transactions each hold what the other wants. Here is how to read the deadlock report, find both statements, and restructure so it cannot happen again.
PostgreSQL
You added the index and the query is still slow. Here is how to read a Postgres query plan properly and find the row estimate error causing it.