Ledgerly’s invoices table had grown to 200 GB, and we needed to split it. A normal ALTER TABLE would have locked writes for hours in the middle of the working day.
Instead of one big migration, I added the new columns, dual-wrote to both shapes, backfilled in small batches overnight, and only then switched reads behind a feature flag.
The switch took three weeks, and users never noticed. Now every schema change on the team follows the same expand-and-contract playbook.
Barış Sezer

