The InnoDB table type includes the following features:
Support for transactionsThis is discussed at the start of this section.
Advanced crash recovery featuresThe InnoDB table type uses logs, which are files that contain the actions that
MySQL has taken to change the database. With the combination
of a log and the database, MySQL can recover effectively from power losses, crashes, and other basic database failures. Of course, nothing can help you recover from loss of a machine,
failure of a disk drive, or other catastrophic failures. For these, you need offsite backups and new hardware.
Row-level lockingWe’ve explained how MyISAM locks at the table level, and the advantages and disadvantages of this. InnoDB locks at the row level, meaning that only the rows of data that are affected
are unavailable to other users, which promotes better concurrency (sharing) of resources in certain circumstances. For applications that write more data than they read, or for applications that change large amounts of data when they do, InnoDB maybe abetter choice than MyISAM.
Foreign-key supportInnoDB is currently the only MySQL table type that supports foreign keys.
Fast, flexible indexingThe InnoDB type chooses the right data structure for the task when you create an index.
It can switch from the fast, exact-match
hash index to the fast, all-around
B-tree index as the need arises, giving you fast searching for most applications without you having to explicitly set the index type.
The InnoDB type has the following limitations:
More features means more to understandYou need to know about transactions, foreign keys,
data versioning, and other features to use it effectively.
It’s difficult to setup iIt hastens of startup parameters and options, and to use it effectively, you need to understand and tune these. If you’re planning on using it, you need to know its details because that’s why you’ve chosen it over MyISAM. Tuning InnoDB requires a book of its own!
It’s disk-hungry
To support its transaction-safe and robust behavior, InnoDB needs extra disk space. MyISAM is much more compact because it doesn’t have these features.
Locking overheads
Row locking is more complex than table locking, and so it’s slower and takes more memory.
Share with your friends: