Adding a new column should be simple. Yet in production workloads with live traffic, it can be risky. The operation can lock rows, block writes, or trigger cascading changes. The right approach depends on your database, table size, query patterns, and uptime requirements.
In PostgreSQL, adding a new column without a default value is fast. The command updates only the metadata. But once you add a default or a NOT NULL constraint, the database rewrites the table, which can be slow for large datasets. Use ALTER TABLE ... ADD COLUMN with care. For MySQL, performance changes by engine type. InnoDB will often copy the table for structural changes unless you use instant DDL features available in recent versions.
Plan for indexing and backfill strategies. Adding an index on a new column in a big table can lock or degrade performance during the build. Consider partial indexes, rolling backfills, or creating the column first before populating it with background jobs.