Differences between MyIsam and InnoDB

Source: Internet
Author: User

"The MyISAM type does not support advanced processing such as transaction processing, while the InnoDB type does"
 
This is an online explanation of MyISAM and InnoDB. It is very abstract. Let's explain it in vernacular.
 
In fact, it is relatively simple
 
The so-called transaction processing is an atomic operation.
For example, the Innodb table that supports transaction processing creates a forum and posts points. You have posted a post to execute an insert statement to insert the post content. After insertion, You need to execute an update statement to increase your points. Assume that the insert operation is successful, but the update operation is not executed. That is to say, you posted a post but did not increase the corresponding points. This will cause user dissatisfaction. If transaction processing is used, insert and update are all put into the transaction for execution. At this time, data is updated and written to the database only when both insert and update statements are generated. If any of the statements fails, the data is rolled back to the initial state, write is not performed. This ensures that insert and update are executed together.
 
 
The mysiam table does not support transaction processing, and the mysiam table does not support foreign keys. Do not need to mention the foreign key? If you do not know, go to the Internet to check it.
At the same time, when the database write operations (insert, update, delete) are performed, the mysiam table locks the table, while the innodb table locks the row. In other words, if you execute an update statement, the mysiam table will lock the entire table and other insert, delete, and update statements will be rejected, the update statement is executed in sequence after it is executed.
 
 
The lock row means that if you execute the update statement, mysql will only lock this record, only other write and update operations for this record will be blocked and executed after the update statement is executed. Write operations for other records will not be affected.
 
 
Therefore, when your database has a large number of write and update operations and few queries or high data integrity requirements, choose innodb table. When your database is mainly used for queries, there are fewer updates and writes in comparison, and the business data integrity requirements are not that strict, select the mysiam table. Because the query efficiency and speed of mysiam tables are faster than that of innodb

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.