Adding a new column sounds simple. In production, it can break queries, lock tables, and stall deployments. Execution speed is critical. Downtime is expensive. The goal is to add new columns without breaking reads or writes and without slowing the system.
First, plan the schema change. Decide on the column name, data type, and default value. Use a naming convention that is consistent with the rest of your database. Avoid reserved words. Check the impact on indexes. Adding an index too early can slow writes. Adding one too late can slow reads.
Second, apply the change in a safe, non-blocking way. For large tables in MySQL or PostgreSQL, online DDL or a tool like gh-ost or pg_online_schema_change can add a column without locking. Always test against realistic datasets to measure the migration time.