A schema change sounds simple. It’s not. New columns slice into the core of a database, touching queries, indexes, and migrations. You need to handle it with precision.
Choosing the right column type is step one. Keep types consistent with existing data models to avoid casting errors. For high-traffic systems, think about how the new column fits with indexes. Adding an indexed column can speed up reads but slow down writes.
Plan your migration path. In production, never block the main thread. Use additive changes first—create the new column, then backfill data asynchronously. Watch for locking. On large tables, a naive ALTER TABLE can lock rows for minutes or hours. Use online schema change tools when needed.