Adding a new column is one of the most common database schema changes. It looks simple, but it carries weight. Done wrong, it can lock tables, block queries, and break deployments. Done right, it becomes invisible, fast, and safe.
When you add a column in SQL, the impact depends on your database engine, table size, and whether you set defaults or constraints. In PostgreSQL, adding a nullable column is nearly instant. Adding one with a default on a large table can rewrite the entire thing and cause downtime. MySQL behaves differently, depending on storage engine and version. Knowing these differences is the first step toward safe migrations.
Plan ahead. Check the table size and query patterns. If you need defaults, consider a two-step process: add the column as nullable, update rows in batches, then set the default and constraints. This reduces locking risk. Always test on a staging environment with realistic data volumes before making the change in production.