Adding a new column sounds simple, but mistakes here can lock tables, block writes, and break production. The fastest path is often the one that causes the most damage. To do it right, you must plan for schema evolution without disrupting service.
A new column changes the contract between your application and its database. First, decide on the name, type, and nullability. Avoid names that require escaping. Choose a type that matches the data’s future use, not just the first value you will store. Nullability matters for both performance and code complexity—default to NOT NULL with a safe default when possible.
In PostgreSQL, adding a nullable new column with no default is instant. Adding a non-nullable column or a default will rewrite the entire table, creating downtime on large datasets. MySQL’s behavior depends on storage engine and version; recent InnoDB optimizations make some operations online, but large-scale ALTER TABLE commands still warrant caution.