DBMigrationBestPractices
Contents
Database Migration Best Practices
Database migrations have historically been a source of considerable downtime when deploying new versions of Openstack services.
Schema Migrations
Schema migrations are any schema changes that create, drop or rename tables, columns, indexes and foreign keys. In some cases, making a schema change will cause the database engine to block reads and writes to the tables affected. Depending on the size of the table and the operation being performed, this can be up to an hour or more.
MySQL Considerations
Not all versions of MySQL are made alike. Older versions (such as 5.1) will block reads/writes for pretty much any schema changes. Newer versions (5.5 and 5.6) are much better and in many cases much faster and/or online (without blocking reads/writes).
FIXME: Fill in matrix of versions and schema changes that block
Data Migrations
Data changes are any migrations that alter data already in tables. For instance, moving data from one table to a newly created table would be a data migration.