Adding a new column sounds trivial. In production, it is not. The wrong approach can lock tables, slow queries, and block writes. The right approach starts with understanding how the database engine handles schema changes under load.
First, check the table size and index structure. Large tables with millions of rows and active writes can’t afford blocking DDL. Use ALTER TABLE ... ADD COLUMN with care, and always test it in a staging environment that mirrors production load. For MySQL, consider ALGORITHM=INPLACE or ONLINE options where available. For PostgreSQL, adding a nullable column without a default is usually fast, but adding it with a default on a large table can block. Break it into steps when possible: create the column as nullable, then backfill in batches, and finally set constraints or defaults.
Think ahead about migrations across multiple environments. Schema drift between local, staging, and production can break deployments. Keep new column changes in version-controlled migration files. Use transactional DDL when supported. Ensure the application code is compatible before and after the column is added—deploy feature flags to hide incomplete features until data is ready.