As asked
You need to split a customer_name column into first_name and last_name on a large production table. How do you migrate without downtime?
Sample answer outline
Use an expand and contract migration. Add nullable new columns first, deploy application code that dual-writes old and new fields, and backfill in small batches with throttling and observability. After validating parity, switch reads to the new columns, keep dual-write briefly, then remove the old column in a later migration. Discuss locks, replication lag, rollback, and how to handle ambiguous names or bad historical data. Interviewers look for sequencing discipline; candidates often propose a single blocking ALTER and backfill that would hurt production.
Expect these follow-ups
- How would this change if the table receives 10,000 writes per second?
- What validation query proves the backfill is correct enough?
- When do you need a trigger instead of application dual-write?