|What is difference between MYISAM and InnoDB?
||MYISAM supports Table-level Locking
||InnoDB supports Row-level Locking
||MyISAM designed for need of speed
||InnoDB designed for maximum performance when processing high volume of data
||MyISAM does not support foreign keys hence we call MySQL with MYISAM is DBMS
||InnoDB support foreign keys hence we call MySQL with InnoDB is RDBMS
||MyISAM stores its tables, data and indexes in diskspace using separate three different files. (tablename.FRM, tablename.MYD, tablename.MYI)
||InnoDB stores its tables and indexes in a tablespace
||MYISAM not supports transaction. You cannot commit and rollback with MYISAM. Once you issue a command it’s done.
||InnoDB supports transaction. We can commit and rollback with InnoDB
||MYISAM supports fulltext
||InnoDB does not support fulltext
||You can use MyISAM, if the table is more static with lots of select and less update and delete.
||The only viable fast backup option, which can also be used to populate new slave machines, is InnoDB Hot Backup.
||MySQLDump backup is too slow with InnoDB. (If you insist on using it, turn on these flags: –opt –compress)
||Doing a tar/rsync backup where you simply copy all files is not possible with InnoDB.
||LOAD DATA INFILE is too slow with InnoDB. Consider using MyIsam tables for LOAD DATA operations.
||InnoDB has built-in recovery that works 99% of the times automatically. Never try to move .frm or .ibd files around as a way of "helping" the database to recover. If the built-in recovery doesn’t work, switch to your slave server and restore the primary from backup.
||Never ever change my.cnf INnoDB log file size while the database is running. You’ll corrupt the log sequence number beyond repair.
||InnoDB is less forgiving than MyIsam when it comes to queries on non indexes. InnoDB is going to "School" you into ensuring every single query and update statement runs on an index. Issue no index queries and you’ll pay dearly in execution time.
|| If InnoDB crashes and the built-in recovery mechanism is unable to roll-back transactions, your database will not start. This is very important to understand. With MyISAM, even if a table gets corrupted, you can still start the database and everything will work normally. InnoDB will simply refuse to start until you restore the entire database from backup. Make sure you understand this principle and backup religiously.
||For read-heavy environments, use an NDBCluster or setup replication for n MyISAM slave read-only machines.
||For write-heavy environments, InnoDB on an active/passive replication setup is typically the best choice. You may also want to experiment with an NDBCluster. An NDBCluster is generally going to be slower than InnoDB in write-heavy environments, but it offers a higher level of availability.