When it comes to databases, one of the most frequently asked questions is how to choose a storage engine in MySQL that meets current business needs. MySQL supports many storage engines, so what are they and how to use them elegantly? Reasons for dividing the engine In the file system, MySQL saves each database (also called schema) as a subdirectory under the data directory. When creating a table, MySQL will create a .frm file with the same name as the table in the database subdirectory to save the table definition. For example, if you create a table named DebugTable, MySQL will save the table definition in the DebugTable.frm file. Because MySQL uses file system directories and files to store database and table definitions, case sensitivity is platform-dependent. On Windows systems, upper and lower case characters are not case sensitive; on Unix-like systems, they are case sensitive. Different storage engines store data and indexes in different ways, but the table definition is handled uniformly in the MySQL service layer wk. View Support Engines To find out which engines are supported in MySQL, you can use the following command: show engines; The results are as follows (MySQL version: Ver 8.0.19): mysql> show engines; +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+ | Engine | Support | Comment | Transactions | XA | Savepoints | +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+ | FEDERATED | NO | Federated MySQL storage engine | NULL | NULL | NULL | | MEMORY | YES | Hash based, stored in memory, useful for temporary tables | NO | NO | NO | | InnoDB | DEFAULT | Supports transactions, row-level locking, and foreign keys | YES | YES | YES | | PERFORMANCE_SCHEMA | YES | Performance Schema | NO | NO | NO | | MyISAM | YES | MyISAM storage engine | NO | NO | NO | | MRG_MYISAM | YES | Collection of identical MyISAM tables | NO | NO | NO | | BLACKHOLE | YES | /dev/null storage engine (anything you write to it disappears) | NO | NO | NO | | CSV | YES | CSV storage engine | NO | NO | NO | | ARCHIVE | YES | Archive storage engine | NO | NO | NO | +--------------------+---------+----------------------------------------------------------------+--------------+------+------------+ 9 rows in set (0.00 sec) Storage Engine Classification MySQL storage engines are classified into MyISAM, InnoDB, Memory, Merge, etc. You can see the supported engines listed in the table above, but the most commonly used engines are MyISAM and InnoDB. For the storage engines mentioned above, the following table compares them: Differences between MyISAM and InnoDB The main difference between the two types is that InnoDB supports transactions and foreign key and row-level locks.
Application Scenario
The above is the details of the selection of MySQL storage engine. For more information about MySQL storage engine, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
>>: js to realize login and registration functions
1. Complexity of front-end engineering If we are ...
Create a test table -- --------------------------...
Preface Many web applications store data in a rel...
1. Vulnerability Description On May 15, 2019, Mic...
Preface Everyone knows how to run a jar package o...
This is my first time writing a blog. I have been...
This article shares the specific code for WeChat ...
<br />Looking at this title, you may find it...
1. Get is used to obtain data from the server, wh...
Table of contents Summarize Sometimes we need to ...
Table of contents 1. Write Webshell into outfile ...
In many projects, it is necessary to implement th...
1. Prepare the Docker environment 2. Search for f...
This article shares with you the specific method ...
I was woken up by a phone call early in the morni...