Adding a new column should be fast, safe, and reversible. The method depends on the size of the table, the database engine, and uptime requirements. A careless ALTER TABLE can lock writes, cause downtime, or trigger unexpected rebuilds. Before running a migration, you need to know exactly how the database will execute it.
In PostgreSQL, adding a nullable column with a default value pre–version 11 rewrites the entire table; in later versions, it’s instant for certain data types. In MySQL, adding a new column can be online with ALGORITHM=INPLACE, but only for compatible changes. For sharded or high-traffic systems, the migration often happens in two steps: first create the column as nullable with no default, then backfill in controlled batches.
Always run migrations in staging with representative data volumes. Check for replication lag before backfilling. Use transaction-safe scripts that can resume if interrupted. Keep DDL and DML separate. Monitor CPU, I/O, and query latency throughout the change.