Skip to content
Interview rounds

Databases & caching · Design under changing requirements

Renaming a column while two versions run

A column on a busy PostgreSQL table must be renamed while old and new versions of the service run side by side. How do you do it with no failed requests?

BackendSenior14 min
Interview-style scenarioLast reviewed: Checked against official documentation

Thursday 10:15 · order-service, design reviewIllustrative scenario, not a real incident

Change request: rename orders.user_ref to customer_id. Last night's attempt was reverted after four minutes

The order service runs on 12 pods and writes about 3,000 rows a second to the orders table in PostgreSQL. The table has 400 million rows.

Last night a migration changed the name of the column and the new version began to roll out behind it. Requests failed at once, and the team put the old name back four minutes later.

A rolling deploy replaces the pods one at a time and takes about 15 minutes. The team must be able to roll a release back for a day after it ships.

What the dashboards and logs show

Table
orders, 400 million rows, about 3,000 writes a second
Rolling deploy
12 pods, about 15 minutes from first to last
Last night
5xx on order requests for four minutes, then reverted
Rollback rule
any release can be rolled back for 24 hours

Clarify · optional · scored under "Hypothesis before change"

Ask the interviewer

0 of 3 asked

Each question reveals a fact. What you ask before you act is part of your score.

First move · scored under "Mitigate before root cause"

The release manager asks whether tonight's second attempt may go ahead as planned. What do you say first?

Your rubric score, the model answer, the follow-up questions and the related lessons appear once you have answered the last step.