Schema changes look simple until they hit real data at scale. A new column can lock tables, break queries, or trigger cascading updates across services. In distributed systems, the wrong migration strategy can cause downtime or inconsistent states. The right approach preserves performance and integrity.
Start with a migration plan. In relational databases, decide if the new column needs a default value or can be nullable. Adding a column with a default can force a full table rewrite in some engines. For large datasets, use an online migration tool or break the change into non-blocking steps.
In PostgreSQL, adding a nullable column is fast—it only updates metadata. Adding a column with DEFAULT now writes data to every row if the server version is old. MySQL can behave differently; some operations are instant, others rebuild the table. Test this in a staging environment with production-sized data before deploying.