Adding a new column in a database should be simple. Yet schema migrations in real systems are rarely straightforward. Table size, system load, locking behavior, and backward compatibility each matter. A careless ALTER TABLE can block queries, spike CPU, or cause downtime.
When adding a new column, first confirm nullability and default values. Default values in large tables can trigger a full table rewrite. On PostgreSQL, adding a nullable column without a default is instant, but with a default it can rewrite millions of rows. On MySQL, certain storage engines lock the table for the operation. Understand the physical impact before running the migration.
Plan deployments so that application code and schema changes remain compatible across versions. Add the new column first, deploy code that writes to it second, then shift reads to it last. Avoid destructive changes until old code paths are gone. In distributed systems, stagger the rollout to minimize impact.