The migration was already in motion when the request landed: add a new column. No pause, no downtime. The system was live, and millions of rows were in play.
Adding a new column to a production database is simple in theory but loaded with risk. Schema changes affect performance, integrity, and deploy speed. A careless approach can lock tables, block writes, or break queries. Done right, it’s seamless. Done wrong, it’s a postmortem waiting to happen.
The first step is knowing the database engine’s behavior. In PostgreSQL, adding a nullable column without a default is fast. Adding a column with a default value rewrites the table — and that’s where hours turn into outages. MySQL behaves differently, especially across versions. Know the internals before touching production.
Always test schema changes in a staging environment mirroring production data size and load. Check index impacts, query plans, and any ORM-generated SQL. Monitor replication lag during test applies. This is not optional if you want predictable deploys.