The table was failing. Queries slowed, indexes groaned, reports lagged. The fix was simple: a new column.
Adding a new column is one of the most common schema changes in any production database. It looks harmless, but in the wrong environment it can block writes, inflate storage, or introduce subtle bugs. The process must be planned.
First, confirm the purpose of the column. Define its data type, nullability, and default values. Defaults can lock large tables during migration. For high-traffic systems, avoid defaults that require the database to backfill every row at once. Instead, create the column without a default, backfill in small batches, and then add constraints.
Second, use a schema migration tool that supports online changes. Many databases now offer ADD COLUMN operations that run without blocking reads and writes, but behavior varies by engine. PostgreSQL can add a nullable column instantly. MySQL’s performance depends on storage engine and version. Test the migration on a clone of production data to measure impact.