Engineering Note

One database migration involved 120M+ records. Downtime was never an option.

A customer once asked,

"How long will the maintenance window be?"

Our answer was simple:

"There won't be one."

The challenge wasn't moving the data.

It was moving it without anyone noticing.

The application was processing live traffic while millions of records were being updated.

Stopping writes wasn't an option.

So instead of a big-bang migration, we broke it into phases:
* Started writing to both old and new tables (dual writes)
* Migrated historical data in small batches using background jobs
* Verified record counts and data consistency continuously
* Switched reads only after everything matched
* Removed the old table after monitoring production for a few days

The outcome:
* 120M+ records migrated
* Zero downtime
* No customer impact
* No rollback required

The biggest lesson?

Large database migrations are not database projects.

They are reliability projects.

The safest migration is the one your customers never realise happened.