Adding a new column to a database table seems simple until it isn’t. Schema changes touch multiple layers: the database, the ORM, the application code, and the data itself. The way you introduce that column can decide whether your system stays online or stalls.
The safest path starts with understanding the database engine’s behavior. In PostgreSQL, adding a new column with a default value on a large table will lock writes. MySQL can block reads during the same operation if misconfigured. Use ALTER TABLE with care, and always measure the performance cost on a staging environment before doing it in production.
Backfilling is the next hurdle. Never update millions of rows in one transaction unless downtime is acceptable. Instead, backfill in batches, using small, atomic updates. Control concurrency to prevent load spikes. Monitor replication lag if you run read replicas.