Adding a new column to a database table is one of the most common schema changes, but it can break production if done carelessly. The goal is to make the change without downtime, data loss, or performance collapse. This means understanding both your database engine and the workload it serves.
First, define the new column explicitly. Choose the correct data type, nullability, and default value. Avoid implicit conversions that will lock or rewrite massive amounts of data. If the table is large, adding a non-nullable column with a default may trigger a full table rewrite. Test the migration on a realistic copy of production data before touching the live system.
Second, use online schema change tools where possible. MySQL has ALTER TABLE ... ALGORITHM=INPLACE or ALGORITHM=INSTANT for instant addition of columns under certain conditions. PostgreSQL allows adding nullable columns instantly, but adding them with a default can still lock writes. Learn the specifics of your database version before you run the command.