Before migrating a MySQL database to AWS Relational Database Service, be sure to understand the impact of that move if any tables in your MySQL database utilize the MyISAM engine. Specifically AWS repeats this warning in many places:
Amazon RDS automated backups and DB snapshots are currently supported for all DB engines. For the MySQL DB engine, only the InnoDB storage engine is supported; use of these features with other MySQL storage engines, including MyISAM, may lead to unreliable behavior while restoring from backups. Specifically, since storage engines like MyISAM do not support reliable crash recovery, your tables can be corrupted in the event of a crash. For this reason, we encourage you to use the InnoDB storage engine.
Determine if your database contains MyISAM tables
Use this query to list the MyISAM tables in your database. As the root user, run the following query:
SELECT TABLE_SCHEMA, TABLE_NAME, ENGINE FROM INFORMATION_SCHEMA.TABLES WHERE ENGINE = 'MyISAM';
Solution Options
1. Convert MyISAM tables to InnoDB tables.
- This solution is best if you can do it, but there may be reasons you cannot. E.g., vendor support requires that you don't meddle with the database configuration used by their software.
- Understand the impact of making the change. See http://stackoverflow.com/questions/3818759/what-is-innodb-and-myisam-in-mysqlIf you can swing it, the conversion is easy:
ALTER TABLE table_name ENGINE=innodb, ALGORITHM=COPY;
2. Be ready to repair MyISAM tables in the event of a crash. Be ready for the potential of data corruption or loss.
If you choose to use MyISAM, you can attempt to manually repair tables that become damaged after a crash by using the REPAIR command (see: http://dev.mysql.com/doc/refman/5.5/en/repair-table.html). However, as noted in the MySQL documentation, there is a good chance that you will not be able to recover all your data.
3. Try to ensure that you get good snapshots.
Resources
- Amazon Relational Database Service User Guide. This document has a fair amount to say about MyISAM tables–mostly warnings.