Adding a new column should be fast. It should be predictable. In real systems, it often isn’t. Index updates, table locks, constraint checks—these can break deployment windows and block releases. A small schema change on a large table can trigger hours of downtime if done without care.
The safest approach begins with an explicit migration plan. Define the new column with its exact data type, default value, and whether it allows nulls. Avoid non-null constraints at creation on large datasets. Instead, create the column as nullable, backfill data in batches, and enforce constraints only after verification. This reduces lock times and keeps the application online.
For online systems, using a database tool that supports online DDL or shadow tables is critical. MySQL, PostgreSQL, and modern managed databases have features like ADD COLUMN with concurrent operations. For PostgreSQL, ALTER TABLE ADD COLUMN is instant for nullable columns without defaults. But adding a default and making it non-null will rewrite the table—dangerous at scale. Break these steps apart.