Adding a new column in a live database is not just a matter of altering a table. You need to consider query performance, index impact, and backward compatibility. A careless ALTER TABLE on production without planning can lock rows, slow requests, or even take your service offline.
The safest way to add a new column starts with understanding how your database engine handles schema changes. In PostgreSQL, adding a nullable column without a default is fast because it only updates metadata. In MySQL, especially with large tables, it can be a blocking operation unless you use ALGORITHM=INPLACE or tools like pt-online-schema-change.
If the new column needs a default value, populate it in small batches instead of in the ALTER TABLE statement. This avoids full-table writes and keeps latency stable. Always deploy schema changes with backward compatibility in mind: first add the new column, then update the application to read it, and finally write to it once everything is deployed.