MySQL database MyISAM vs. InnoDB storage Engine

Source: Internet
Author: User
MyISAM
①   不支持事务(事务是指逻辑上的一组操作,组成这组操作的各个单元,要么全部成功要么全部失败)。②   表级锁定(更新时锁整个表)③   读写互相阻塞:不仅会在写入的时候阻塞读取,MyISAM还会在读取的时候阻塞写入,但读本身不会阻塞另外的读。④   只会缓存索引:MyISAM可以通过key_buffer_size缓存索引,以大大提高访问性能,减少磁盘I/O,但这个缓存区只会缓存索引,而不会缓存数据。⑤   读取速度较快,占用资源相对少。⑥   不支持外键约束,但支持全文索引。⑦   5.5.5前为默认存储引擎。适合的业务场景:1.  不需要事务支持的业务2.  读数据比较多的应用3.  数据库修改较少的业务4.  对数据一致性要求不是非常高的业务5.  硬件资源比较差的机器可以用MyISAM
InnoDB
①   支持事务:支持4个事务隔离级别,支持多版本读。②   行级锁定(更新时一般是锁定当前行):通过索引实现,全表扫描仍然会是表锁。③   读写阻塞与事务隔离级别相关。④   具有非常高效的缓存特性:能缓存索引,也能缓存数据。⑤   整个表和主键以Cluster方式存储,组成一颗平衡树。⑥   所有Secondary Index都会保存主键信息。⑦   支持分区,表空间,类似Oracle数据库。⑧   支持外键约束,5.5以前不支持全文索引,之后版本支持了。⑨   和MyISAM相比对硬件资源要求比较高。适合的业务场景:1.  需要事务支持的业务2.  行级锁定对高并发有很好的适应能力,但需要确保查询时通过索引完成。3.  读写及更新都很频繁的场景4.  数据一致性要求较高的业务5.  硬件设备内存较大,可以利用InnoDB较好的缓存能力来提高内存利用率,尽可用减少磁盘I/O。

MySQL database MyISAM vs. InnoDB storage Engine

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.