Skip to content
← all posts

Notebook

Databases

Schema design, migrations and concurrency on Postgres and SQL Server, and what each choice cost.

AllAI engineeringDatabases
2026-11-026 min read

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.

concurrencysql-serverpayments
2026-10-317 min read

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.

postgresmigrationsdatabases
2026-10-2215 min read

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.

databasespostgrestime-seriespartitioning