The query ran fast. The table was wide. You needed a new column, and there was no time to break systems or slow release schedules.
Adding a new column is one of the most common operations in production databases. It feels simple, but the wrong approach can lock tables, freeze writes, and force downtime. To get it right, you need a process that respects both the database engine and live traffic.
First, define the column with precision. Name it clearly. Pick the correct data type based on exact storage needs, not guesses. Consider nullability—default values can prevent inserts from failing during rollout.
Second, plan for migrations in a way that minimizes locks. In PostgreSQL, adding a nullable column without a default is fast because it only updates metadata. In MySQL, use ALGORITHM=INPLACE or ALGORITHM=INSTANT when available. For large datasets, split the migration into two steps: add the column with NULL, then backfill data in small batches, allowing normal traffic to continue.