Adding a new column is one of the most common tasks in database evolution. Done right, it’s invisible to users. Done wrong, it stalls deployments, locks tables, and causes downtime. Whether you’re working with Postgres, MySQL, or a distributed store, the steps matter.
First, choose the correct column type. The wrong type means future migrations or wasted storage. Match precision, default values, and constraints to your data needs.
Second, understand the impact on live data. Adding a new column with a default value can rewrite the entire table. On large datasets, this leads to locks and performance drops. In Postgres, adding a nullable column without a default is instant. Populate it later in batches to avoid downtime.
Third, use transactional DDL when possible. This lets you roll back on failure. Some systems lack this; plan accordingly.