Adding a new column sounds simple. In production, it can break everything if done carelessly. Schema changes touch live data. They lock tables. They can cascade through application code, APIs, background jobs, and analytics pipelines. The smallest mistake turns into downtime or silent data corruption.
The first rule of adding a new column is to know the schema state. Inspect indexes. Identify foreign keys. Understand how the column will be read and written. This is not a blind operation.
Next, design the column definition. Set the correct data type from the start. Avoid NULL defaults unless intentional. For high-write tables, think about storage implications and alignment. Decide if an index is needed now or after backfilling.
When adding a new column in PostgreSQL or MySQL, prefer operations that avoid full table rewrites. Use ALTER TABLE ... ADD COLUMN with defaults set after creation. For large datasets, backfill in batches. Run migrations in steps, not in one massive lock.