{"id":437,"date":"2013-09-18T18:44:49","date_gmt":"2013-09-18T02:44:49","guid":{"rendered":"http:\/\/www.yclimw.com\/?p=437"},"modified":"2021-05-31T14:08:16","modified_gmt":"2021-05-31T06:08:16","slug":"d45292ab9f62cc8e2dd622862e6618ec","status":"publish","type":"post","link":"https:\/\/www.yclimw.com\/?p=437","title":{"rendered":"MySQL Engines: InnoDB vs. MyISAM \u2013 A Comparison of Pros and Cons"},"content":{"rendered":"<div class=headline_area>\n<h1 class=entry-title>MySQL Engines: InnoDB vs. MyISAM \u2013 A Comparison of Pros and Cons<\/p>\n<p class=headline_meta>by <span class=\"author vcard\"><span class=fn>Yang Yang<\/span><\/span> on <abbr title=2009-09-02 class=published>September 2, 2009<\/abbr><\/p>\n<\/h1>\n<\/div>\n<div class=\"format_text entry-content\">\n<div style=\"FLOAT: left; MARGIN: 0px 10px 10px 0px\"><\/div>\n<\/div>\n<div class=\"format_text entry-content\">&nbsp;&nbsp;&nbsp;&nbsp;The 2 major types of table storage engines for MySQL databases are InnoDB and MyISAM. To summarize the differences of features and performance,<\/div>\n<div class=\"format_text entry-content\">\n<ol>\n<li>InnoDB is newer while MyISAM is older.   <\/li>\n<li>InnoDB is more <strong>complex<\/strong> while MyISAM is   <strong>simpler<\/strong>.   <\/li>\n<li>InnoDB is more strict in <strong>data integrity<\/strong> while MyISAM is   loose.   <\/li>\n<li>InnoDB implements <strong>row-level<\/strong> lock for inserting and   updating while MyISAM implements <strong>table-level<\/strong> lock.   <\/li>\n<li>InnoDB has <strong>transactions<\/strong> while MyISAM does not.   <\/li>\n<li>InnoDB has <strong>foreign keys<\/strong> and relationship contraints while   MyISAM does not.   <\/li>\n<li>InnoDB has better crash recovery while MyISAM is poor at recovering data   integrity at system crashes.   <\/li>\n<li>MyISAM has <strong>full-text<\/strong> search index while InnoDB has not.   <\/li>\n<\/ol>\n<\/div>\n<p>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.<\/p>\n<h3>Advantages of InnoDB<\/h3>\n<ol>\n<li>InnoDB should be used where <strong>data integrity<\/strong> comes a   priority because it inherently takes care of them by the help of relationship   constraints and transactions.   <\/li>\n<li><strong>Faster in write-intensive<\/strong> (inserts, updates) tables   because it utilizes row-level locking and only hold up changes to the same row   that\u2019s being inserted or updated. <\/li>\n<\/ol>\n<h3>Disadvantages of InnoDB<\/h3>\n<ol>\n<li>Because InnoDB has to take care of the different relationships between   tables, database administrator and scheme creators have to <strong>take more   time in designing<\/strong> the data models which are more complex than those   of MyISAM.   <\/li>\n<li><strong>Consumes more system resources<\/strong> such as RAM. As a matter   of fact, it is recommended by many that InnoDB engine be turned off if there\u2019s   no substantial need for it after installation of MySQL.   <\/li>\n<li><strong>No full-text indexing<\/strong>. <\/li>\n<\/ol>\n<h3>Advantages of MyISAM<\/h3>\n<ol>\n<li><strong>Simpler to design and create<\/strong>, thus better for beginners.   No worries about the foreign relationships between tables.   <\/li>\n<li><strong>Faster than InnoDB on the whole<\/strong> as a result of the   simpler structure thus much less costs of server resources.   <\/li>\n<li><strong>Full-text indexing<\/strong>.   <\/li>\n<li>Especially good for <strong>read-intensive (select) tables<\/strong>. <\/li>\n<\/ol>\n<h3>Disadvantages of MyISAM<\/h3>\n<ol>\n<li><strong>No data integrity<\/strong> (e.g. relationship constraints) check,   which then comes a responsibility and overhead of the database administrators   and application developers.   <\/li>\n<li><strong>Doesn\u2019t support transactions<\/strong> which is essential in   critical data applications such as that of banking.   <\/li>\n<li><strong>Slower<\/strong> than InnoDB for tables that are frequently being   inserted to or updated, because the entire table is locked for any insert or   update. <\/li>\n<\/ol>\n<p>The comparison is pretty straightforward. InnoDB is more suitable for data critical situations that require frequent inserts and updates. MyISAM, on the other hand, performs better with applications that don\u2019t quite depend on the data integrity and mostly just select and display the data.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>MySQL Engines: InnoDB vs. MyISAM \u2013 A Comparison of Pros &hellip; <a href=\"https:\/\/www.yclimw.com\/?p=437\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">MySQL Engines: InnoDB vs. MyISAM \u2013 A Comparison of Pros and Cons<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[287,28],"class_list":["post-437","post","type-post","status-publish","format-standard","hentry","category-17","tag-mysql","tag-28"],"_links":{"self":[{"href":"https:\/\/www.yclimw.com\/index.php?rest_route=\/wp\/v2\/posts\/437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yclimw.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yclimw.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yclimw.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yclimw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=437"}],"version-history":[{"count":2,"href":"https:\/\/www.yclimw.com\/index.php?rest_route=\/wp\/v2\/posts\/437\/revisions"}],"predecessor-version":[{"id":3095,"href":"https:\/\/www.yclimw.com\/index.php?rest_route=\/wp\/v2\/posts\/437\/revisions\/3095"}],"wp:attachment":[{"href":"https:\/\/www.yclimw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yclimw.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yclimw.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}