Adding a new column should be fast, clean, and safe. Whether you are expanding a schema or refactoring production tables, downtime kills momentum. A single migration error can cascade through services. The right approach prevents failures, preserves data integrity, and keeps systems online.
Start with the definition. Decide if the new column is nullable, has a default value, or is part of an index. In relational databases like PostgreSQL or MySQL, migrations must consider table locks. Adding a column with a default can trigger a full table rewrite. For large datasets, this slows queries and stalls other writes. Avoid this by creating the column as nullable, then updating values in small batches, then enforcing constraints.
In distributed systems, schema changes need coordination. If multiple services depend on the table, deploy changes in phases. Introduce the new column without breaking old reads. Once all code paths handle the change, switch to using the new column. No service should assume it exists until it has been deployed everywhere.