PhVHoang / TIL

10 stars 0 forks source link

Zero downtime MySQL migration #393

Open PhVHoang opened 1 year ago

PhVHoang commented 1 year ago
1. Create a table similar to the source table (shadow table)
2. Migrate the shadow table while empty
3. Copy data from the source to the shadow table
  - Triggers
  - MySQL bin logs
5. Rename tables atomically
6. Optionally delete the older table

References

https://www.linkedin.com/pulse/database-reliability-zero-downtime-schema-migrations-chinmay-naik-2xixf/