Adding a new column is more than running an ALTER TABLE command. Done well, it preserves performance, keeps data consistent, and avoids downtime. Done poorly, it can block queries, lock rows, or corrupt production data.
First, confirm the migration strategy. On large datasets, a direct schema change can lock the table. Use online migration tools like gh-ost or pt-online-schema-change to keep the service running. For smaller tables, a simple ALTER TABLE ADD COLUMN may be fine.
Choose the right data type. Know if the column will be nullable and set sensible defaults. Avoid implicit conversions that can slow queries or trigger full table rewrites. If the column will be indexed, plan for the impact on write performance and disk usage.
Run the migration in a controlled environment before production. Verify the column appears in schema introspection tools and test application writes and reads against it. Watch for replication delays or lag in downstream systems.