【转】MySQL引擎: InnoDB vs MyISAM – 比较利弊
网上看到的一篇文章,挺不错,虽然是英文但是很易懂,就不翻译了。
The 2 major types of table storage engines for MySQL databases are InnoDB and MyISAM. To summarize the differences of features and performance,
?
- InnoDB is newer while MyISAM is older.
- InnoDB is more?complex?while MyISAM is?simpler.
- InnoDB is more strict in?data integrity?while MyISAM is loose.
- InnoDB implements?row-level?lock for inserting and updating while MyISAM implements?table-levellock.
- InnoDB has?transactions?while MyISAM does not.
- InnoDB has?foreign keys?and relationship contraints while MyISAM does not.
- InnoDB has better crash recovery while MyISAM is poor at recovering data integrity at system crashes.
- MyISAM has?full-text?search index while InnoDB has not.
In light of these differences, InnoDB and MyISAM have their unique advantages and disadvantages against each other. They each are more suitable in some scenarios than the other.
Advantages of InnoDB
- InnoDB should be used where?data integrity?comes a priority because it inherently takes care of them by the help of relationship constraints and transactions.
-
Faster in write-intensive?(inserts, updates) tables because it utilizes row-level locking and only hold up changes to the same row that’s being inserted or updated.
Disadvantages of InnoDB