The build was stuck. Logs scrolled on the screen. All it needed was a new column.
Adding a new column sounds simple, but shipping it in production without downtime takes planning. Schema changes can lock tables, block writes, and spike CPU. On high-traffic systems, even a “small” migration can stall critical paths. You need the right approach for zero-downtime database migrations.
Start by creating the column without constraints or defaults. This lets the database update metadata instantly instead of rewriting the entire table. In PostgreSQL, ALTER TABLE ADD COLUMN column_name data_type; completes fast when no heavy defaults or indexes exist.
Next, backfill data in small batches. Use a job that reads a window of rows, updates them, and pauses before repeating. This reduces locks and keeps replication lag in check. If replication is in play, watch your monitoring dashboards for lag spikes during backfilling.