The table is running hot. Queries slam it every second. You need a new column, and you need it without waiting hours for a migration window.
Adding a new column seems simple. But in production, the wrong approach can lock rows, spike latency, and cause downtime. Schema changes, especially on large datasets, are not just technical—they’re operational risks. The right process makes all the difference.
Start with the database engine’s native tools. In PostgreSQL, ALTER TABLE ... ADD COLUMN is fast for nullable columns with defaults defined as NULL. Adding a non-null column with a default forces a rewrite of every row, which can be slow. On MySQL, newer versions allow a fast metadata-only change for many column types, but not all. Know your engine’s capabilities before running the command.
For live systems, deploy in two steps. First, add the column as nullable with no default. Second, backfill in small batches, using a scheduled job or controlled migration code. Third, enforce constraints once the data is ready. This reduces locks, keeps queries predictable, and lets you roll forward or back without crisis.