Adding a new column is simple until scale and uptime turn it into a fault line. The wrong migration locks tables, starves queries, and cascades into outages. The right strategy makes it invisible to users and safe for writes.
Start with the schema. Define the new column with the correct type, nullability, and default value. Avoid defaults that trigger table rewrites on large datasets. Use lightweight DDL when supported by your database engine. For PostgreSQL, adding a nullable column without a default is instantaneous. For MySQL, use ALGORITHM=INPLACE to minimize locking.
Deploy in phases. First, ship the schema change with no reads or writes to the new column. Then update the application to backfill data during normal operation or through a dedicated job. Once complete, enforce constraints and drop temporary shims. This avoids downtime and allows safe rollback.