System Design · Senior · Question 65 of 75
How do you rename a database column without downtime?
- ✓Correct answer: Expand/contract: add the new column, write to both, backfill, switch reads, then drop the old column in a later release
- 2Rename it in one migration during deployment
- 3Stop the app for maintenance - the only safe way
Explanation
During rolling deploys old and new code run together, so each step must be compatible with both.