Adding a new column should be routine, but in production it can be dangerous. Poor planning leads to downtime, blocked writes, or inconsistent reads. The safest path starts with knowing the database, the query load, and the migration tools. Choosing the right approach matters more than the syntax.
In relational databases like PostgreSQL or MySQL, adding a new column with a default value can lock the table. On large tables, this can stall critical operations for minutes or hours. The fix is to create the column without a default, backfill in small batches, then set the default for future inserts. This method keeps locks short and the system responsive.
For distributed systems, adding a new column must account for rolling deployments. The application should handle both the old and new schema states during the rollout. Avoid removing or renaming columns until all services have been upgraded and verified.