There is a great writing from Stripe which explains their process for database migration :
- Dual writing to the existing and new tables to keep them in sync.
- Changing all read paths in our codebase to read from the new table.
- Changing all write paths in our codebase to only write to the new table.
- Removing old data that relies on the outdated data model.