Adding a new column is one of the most common schema changes in software. Done right, it is safe, fast, and invisible to users. Done wrong, it can lock tables, block writes, and cause downtime. The difference comes down to process.
First, define the purpose of the new column. Name it clearly. Choose a data type that fits current and future data. Avoid overloading semantics. If this column is part of a critical query path, consider its index impact before adding it.
In relational databases like PostgreSQL or MySQL, adding a nullable column without a default can be near-instant. Adding a column with a default value that needs to backfill every row can be expensive for large datasets. For production systems, measure migration impact in a staging environment with comparable data. Use tools like pt-online-schema-change for MySQL or background migration frameworks for PostgreSQL to keep workloads online.
If you need to populate the new column, backfill in small batches. Monitor replication lag and write latency. Write application code that can handle records where the new column value is not yet set. Deploy this code first, ensuring forward compatibility before the migration runs.