All challenges
Multiple ChoiceHard 45s

Expand-contract: safe schema evolution

Which sequence correctly describes the expand-contract pattern for a breaking database change?
Options
  1. 1Add the new structure (expand), dual-write and migrate, then remove the old structure (contract)
  2. 2Drop the old column first, then add the new one and backfill it from the backups
  3. 3Rename the column in a single migration so that all readers switch over at once
  4. 4Take the service fully offline for the whole change so no partial state is visible

Think you can answer under pressure?

Get matched and answer live questions in 3-minute 1v1 battles. Elo ranking, badge tiers and bragging rights on the line.

Play this in a 3-minute battle