CS FundamentalsVery hardProduct-company DevOps interview

A team wants to rename the column cust_name to customer_name in a live database with zero downtime while old and new app versions run side by side during a rolling deploy. Which approach is correct?

  1. A. Rename the column in one migration just before deploying the new code
  2. B. Deploy the new code first, then rename the column
  3. C. Expand-contract: add customer_name, write to both and backfill, switch reads to the new column, and drop cust_name only after no running version uses it
  4. D. Stop all instances, rename, then restart

Correct answer: C. Expand-contract: add customer_name, write to both and backfill, switch reads to the new column, and drop cust_name only after no running version uses it

During a rolling or blue-green deploy both versions hit the same database, so every schema change must stay compatible with both. Expand (add), migrate, then contract (remove) keeps each step backward compatible.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic