Describe leading a database migration project with zero downtime.
sql-sys-003
Your answer
Answer as you would in a real interview — explain your thinking, not just the conclusion.
Model answer
We needed to split a monolithic users table into separate identity and profile tables without taking the site down. My approach followed the expand-migrate-contract pattern. In the expand phase I added the new tables and wrote application code that wrote to both the old and new structure simultaneously. I also wrote a background migration job that backfilled the new tables in small batches with a rate limiter to avoid locking. Once the backfill was complete I ran a verification query comparing row counts and checksums across both representations. In the contract phase I deployed a version that read exclusively from the new tables, then after a soak period dropped the old columns. Each phase was independently deployable and rollback was a single config flag that switched reads back to the old structure. The most important thing I did was test the entire sequence end-to-end on a production data replica before touching production, including simulating the backfill at production scale to estimate duration. Zero downtime was maintained throughout.
Follow-up
How did you handle the 'dual-write' consistency window where the old and new structure could diverge? What was your strategy if the backfill job fell behind due to write load?