简体   繁体   English

InnoDb与MyISAM的碰撞复原力

[英]Crash resilience of InnoDb vs. MyISAM

We run a MySQL server on Windows. 我们在Windows上运行MySQL服务器。 Sometimes, Windows crashes, and leaves the database in a corrupt state ("Duplicate entry for key 'PRIMARY'" messages though the key is auto-generated; that can be repaired with a "Repair table" command). 有时,Windows崩溃,并使数据库处于损坏状态(尽管密钥是自动生成的,但“密钥'PRIMARY'的重复条目”消息;可以通过“修复表”命令修复)。

I have seen that problem with MyISAM tables only, never with an InnoDb table. 我只看到MyISAM表的问题,而从来没有看到InnoDb表的问题。 Did that happen by chance, or is InnoDb with its extra code for transactions actually more resilient towards such failures? 这是偶然发生的吗,还是InnoDb带有用于交易的额外代码实际上对这种失败更具弹性?

MyISAM does not support any of the four qualities of ACID databases . MyISAM不支持ACID数据库的四种质量中的任何一种。

InnoDB is designed for crash recovery. InnoDB专为崩溃恢复而设计。 It has several features that prevent such corruption in the case of crashes, and also recover from crashes automatically, so you don't have to run REPAIR TABLE. 它具有多种功能,可以防止崩溃时发生此类损坏,并且还可以从崩溃中自动恢复,因此您不必运行REPAIR TABLE。

InnoDB has been the default storage engine since MySQL 5.5.5 in 2010 . 2010MySQL 5.5.5起,InnoDB一直是默认的存储引擎。 It's clear that MySQL is moving (slowly) in the direction of phasing out MyISAM. 显然,MySQL正在(逐步)朝逐步淘汰MyISAM的方向发展。 In MySQL 8.0, even the system tables in the mysql schema have been converted to InnoDB. 在MySQL 8.0中,即使mysql模式中的系统表也已转换为InnoDB。

It's really time to just consider MyISAM obsolete technology and stop using it. 现在是时候考虑MyISAM过时的技术并停止使用它了。 We should honor its place in history, but move on to a better solution. 我们应该尊重它在历史上的地位,但继续寻求更好的解决方案。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM