High traffic app that can’t take downtime - Data migration

twitter logo github logo ・1 min read

When you can't take downtime, the “trick” to data migration is: Think small changes.

  1. New table
  2. Update writes to go to old and new
  3. Background job to migrate old data to new
  4. Move reads to new table
  5. Stop writing to old table

Each of these steps is a deploy.

twitter logo DISCUSS (6)
markdown guide
 

This tip is 🔥!

For Rails apps, I love using the strong_migrations gem to encourage small, safe steps like these.

 
 

I would recommend checking LHM out if you're on rails. We have used it for multiple major migrations and it works like a charm.

 
[deleted]
 
Classic DEV Post from Mar 20

What does a dev's personal website need to include?

Mike Coutermarsh profile image
code @github