Adding a new column in production is never just a schema change. It is a shift in your system’s contract with the world. The wrong migration can lock your database, drop queries into dead air, or cascade failures through dependent services.
Start by defining the column with precision. Name it in a way that reflects its purpose, aligns with naming conventions, and avoids collisions. Choose the data type to match the expected range, nullability, and indexing needs. Avoid default values unless they are semantically correct; defaults mask missing data and can pollute analytics.
Think about backward compatibility. Add the new column without breaking existing reads or writes. In relational databases, use ALTER TABLE with care. On large datasets, consider online schema change tools like pt-online-schema-change or gh-ost to avoid blocking writes. For distributed systems, roll out the schema change before deploying code that writes to it.