← all posts
Notebook
Databases
Schema design, migrations and concurrency on Postgres and SQL Server, and what each choice cost.
Two bets, one balance
Two bets spent the same hundred and left a perfectly normal-looking zero. The fix was to make the second bet wait before it decided anything.
Changing a Column on a Big Postgres Table Without a Long Table-Rewrite Lock
An illustrative integer-to-bigint migration, split into expand, sync, backfill, validate, switch and contract—with explicit lock and recovery limits.
Designing a Time-Series Table That Survives Its Own Growth
A table of timestamped readings works fine until it doesn't. Here is how I split it by month, kept a small hourly summary, and what each choice cost me.