Adding a new column sounds simple. It is not. The wrong approach can lock tables, stall writes, and break production. The right approach keeps your system online, your data safe, and your deployment clean.
A new column changes the schema. This means the database must rewrite metadata and sometimes touch every row. In PostgreSQL, adding a nullable column with no default is fast. Adding a column with a default value on a large table can block for minutes or hours. In MySQL, an ALTER TABLE often creates a full table copy. This can crush throughput if done during peak hours.
Plan your migration. Check table size. Test on staging with production data volumes. Use tools like pgmig for PostgreSQL or gh-ost for MySQL to run online schema changes without downtime. Batch updates to backfill data after the column exists instead of during the change. Monitor locks and replication lag during the process.