All jobs / Database administrator / Migrations
Database administrator interview question · 1–3 years
A migration has copied a few hundred tables into a new database and the team wants to switch over tonight.
How do you prove the data actually arrived intact?
The strongest answer
Row counts per table, checksums on the key and numeric columns, a sample of rows compared end to end, and business queries that must give the same answer on both sides
Why it works
Exactly — counts catch missing rows, checksums catch changed values, and a business query catches the truncation or encoding problem that neither notices.
What a good answer covers
- Counts catch missing rows.
- Checksums catch changed values.
- Compare real business answers.
- Record the evidence before switching.
Answers that fall short
- Close, but not the strongest: I compare row counts for every table and spot-check a few rows by hand
Counts are the first check and the weakest: the same number of rows can still hold silently truncated or re-encoded values. - Weak: The migration tool reported success and logged no errors, so the data is fine
Tools report what they attempted; type coercion, collation changes and truncation usually pass without an error. - Red flag: We switch over and let users report anything that looks wrong to them
Users as the validation step means the first person to find the problem is a customer, after the old system is gone.
Who gets asked this
More Migrations questions
- A migration adds a NOT NULL column with a default to a table with hundreds of millions of rows. Concern?
- You need a new index on a busy table. How do you build it?
- How do you rename a heavily used column without downtime?
- A backfill must touch every row of a large live table. How do you run it?
- How do you plan a major version upgrade of a production database?
- How do you upgrade a major database version across a large fleet with near-zero downtime?
- A major engine version upgrade is planned for the platform a dozen applications sit on. How do you test…
- A change freeze is in force and a team needs an urgent index to stop a customer-facing slowdown. How do you…