The logs showed nothing unusual, but the table had grown, and the demand for a new column could not wait.
Adding a new column in production feels simple until you account for scale, locked writes, and schema drift. A direct ALTER TABLE might lock rows for seconds or minutes, depending on size, indexes, and the database engine. In high-traffic systems, that lock can cascade into timeouts and errors.
Plan the schema change. Decide if the new column will allow NULL, have a default value, or be computed. Avoid setting expensive defaults directly in the ALTER TABLE statement unless you can tolerate the immediate performance cost. In many SQL databases—PostgreSQL, MySQL, SQL Server—adding a nullable new column without a default is fast because it only updates metadata.
For sensitive migrations, use an online schema change tool or phased deployment. First, add the new column as nullable with no default. Then backfill the data in controlled batches, ensuring writes do not block. Finally, add constraints or defaults once the backfill is complete. With proper indexing strategy, you can avoid long locks on update-heavy tables.