Adding a new column sounds simple. It is not. It touches schema, data migration, indexing, and code paths. If you act without thinking, you can bring a system down.
Start with the schema change. Decide on the column name, data type, nullability, and default value. Keep naming consistent with existing conventions. Avoid names that leak internal logic or introduce ambiguity.
Next, plan the migration. For small tables, a direct ALTER TABLE works. For large tables, break the migration into safe steps. Create the column with a default. Backfill in batches to avoid locking. Verify row counts between old and new states.
Indexing is where performance changes. A poorly chosen index can slow writes and explode storage. Add indexes only after analyzing query plans and measuring load impact. Remove obsolete indexes tied to old patterns.