Chapter 22 · Part 4

Data Migration, Backfill, and Reconciliation

A focused chapter on data migration, backfill, and reconciliation, with practical delivery concerns, trade-offs, and the operational questions behind CI/CD work.

22-1

Why Data Migration Feels Different From Application Deployment

You have your CI/CD pipeline running smoothly. Application deployments are routine. Rolling updates, blue-green deployments, even canary releases—your

5 min
22-2

Writing Database Migrations That Won't Break When Run Twice

You're deploying a new feature that needs an extra column in the users table. You write the migration script, run it in staging, everything looks good

5 min
22-3

Why You Should Always Dry-Run Database Migrations Before Touching Real Data

You have written a migration script. It looks correct. The logic is sound. You run it on staging, and everything passes. But when you run it on

4 min
22-4

Backfilling Legacy Data Without Breaking Your Production Database

You just deployed a new migration that adds a lastloginat column to the user table. The schema change went smoothly. But now you look at the data: every

6 min
22-5

Data Reconciliation: Proving Your Migration Worked Correctly

You just finished a data migration. The script ran without errors. The logs look clean. The team is ready to move on. But deep down, you have that nagging

6 min
22-6

When Data Migration Goes Wrong: Rollback Strategies That Actually Work

You have just deployed a database migration to production. The script ran for twelve minutes, altered three tables, moved data between columns, and then

6 min
22-7

When Database Migrations Need Their Own Pipeline

You have a solid CI/CD pipeline for your application. Code gets built, tests run, and deployments happen automatically. Then someone opens a pull request

5 min