Adding a new column seems simple. It can be catastrophic if done without care. Schema changes affect performance, uptime, and data integrity. A single migration can lock rows, stall queries, or even take down production.
Before running ALTER TABLE, measure the blast radius. Know the size of the table. Know how your engine applies changes. In MySQL, adding a column can trigger a full table rewrite. In PostgreSQL, certain column additions are fast, others are not. Understand storage engines and their trade-offs.
Choose the right data type at the start. A poorly chosen type leads to bloat and slow queries. If you need defaults, set them deliberately and know whether they require rewriting existing rows. Keep nullability in mind; forcing NOT NULL on large datasets can be expensive.
Run schema changes in a controlled environment. Test migrations against production-like data. Use online schema change tools like gh-ost or pg_online_schema_change for high-traffic systems. Break massive changes into smaller steps. Deploy them incrementally.