In the following article, I will attempt to describe the differences between MySQL and the MyISAM and InnoDB engines. I have been trying for some time to find relevant information for making decisions that can directly influence the performance of a web system, and I believe I can briefly summarize some differences to help developers make the right choice.
I faced this dilemma when trying to improve the performance and speed of a particular site with more than 10,000 daily visits and relational databases with more than 200,000 records. An IDEAL solution is proper planning to avoid unnecessary queries or to ensure that the client directly handles the database execution load.
MySQL
MySQL is an open-source system that allows information storage on computer systems, which, in turn, allows the choice of engines such as InnoDB and MyISAM, among other less relevant ones.
Beyond the tuning that can be done to the MySQL configuration (my.cnf, 50-server.cnf, etc.) for performance improvements in caching, CPU usage, RAM usage, or buffering on a VPS, you can configure the allocation of two engines per table: InnoDB and MyISAM.
MyISAM In my opinion, MyISAM is more popular due to its simplicity. It\'s a straightforward engine that makes database management easier. It can be optimized relatively easily. MyISAM consumes less RAM than InnoDB, making it suitable for servers with limited resources or small databases (for example, a store with fewer than 2,000 products or low traffic).
I\'ve generally used MyISAM because it\'s the default engine for table creation and is also versatile. However, when dealing with large volumes of data and high traffic, simply tuning the cache is insufficient.
InnoDB
InnoDB is a storage system that has prevailed and become established due to its good performance and reliability. Currently, on MySQL versions 5.6 and above, it is the default engine for generating tables in MySQL (in my personal research, I have found that classic CMS platforms like PrestaShop, since version 1.7, have adopted this engine as their default, though not yet WordPress).
Tables in InnoDB organize data using a primary key, slowing down data updates (UPDATE) and insertions (INSERT). However, it is faster for querying large databases.
Conclusions
It is necessary to be familiar with different types of database engines. When choosing one, it should not be based on personal preferences, but rather on its suitability for each type of project generated from data analysis (or the emergence of problems as a consequence).
MyISAM should be faster for inserting, updating, and deleting records, but it performs worse with large relational databases.
InnoDB is also a fast engine, notable for its row-level (not table-level) locking, transactions, and relational table design. It excels when you have tables that are executed too frequently. Under normal conditions, table-level locking should be sufficient.
Outros artigos que podem lhe interessar
Comentários
0Seja o primeiro a comentar