Adding a new column should be fast, controlled, and reliable. In SQL, ALTER TABLE is the obvious choice. It works, but in production environments, the impact of schema changes can be brutal. Lock times grow with table size. Writes can stall. Replication lag can spike. For high-traffic systems, this can mean downtime and lost revenue.
There are two paths: direct SQL changes or tools designed for online migrations. Direct changes are simple but risky for large datasets. Online schema change tools such as pt-online-schema-change or gh-ost add the new column in a rolling fashion, migrating data without locking the entire table. They create a shadow table, copy data in batches, keep it in sync, and then swap names in a final atomic operation. This reduces risk, but adds operational complexity.
When adding a new column in PostgreSQL, the cost depends on defaults and constraints. Adding a nullable column is near-instant. Adding a column with a default value before version 11 rewrites the entire table. With MySQL, certain additions are in-place, but most still require a full table rewrite unless using online DDL features. Planning requires checking exact engine capabilities and version-specific behavior.