Adding a new column sounds simple. It is not. The wrong approach locks production, corrupts data, or blocks deploys. The right approach makes the change invisible to users and safe for the system.
When you add a new column, start by defining its purpose with precision. Use clear names that match the domain. Avoid overloading meaning. If the column stores timestamps, use created_at or updated_at. If it is a foreign key, declare it explicitly with constraints.
In relational databases like PostgreSQL or MySQL, adding a column with no default and allowing nulls is often instant. Adding a column with a default in older versions may rewrite the entire table. That rewrite can lock writes for minutes or hours. Always check the database version and test on realistic data sizes before running in production.
For large datasets, break the change into safe steps: