The migration hit production at 02:14. All services stayed green, but the logs told a different story. A new column had appeared in the database schema, and every query that touched it slowed to a crawl.
Adding a new column is not simple. It changes storage layout, indexing, and query execution plans. Whether you are working with MySQL, PostgreSQL, or a distributed database, you need to understand how the engine handles schema changes. Online DDL operations, background index creation, and lock minimization are not just buzzwords—they decide whether your deployment survives the change.
When you add a new column, consider the column type, default value, and nullability. A column with a large default value may rewrite an entire table. In PostgreSQL, adding a nullable column with no default is fast, because it updates only the system catalogs. In MySQL, the impact often depends on the storage engine. For InnoDB, adding a column in older versions could block writes, but newer releases implement instant ADD COLUMN for some cases.
Indexing a new column is another step. Creating an index during the same migration may cause downtime or replication lag. Plan indexes separately, and be aware of how your database handles concurrent index builds. Schema migrations should also be wrapped in transactions when supported, so they can be rolled back instantly on failure.