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
This article shares the specific code of Vue usin...
Preface When creating a primary and foreign key f...
Introduction to structure and performance HTML st...
Table of contents 1. Overview 1.1 What is strict ...
Table of contents 1. Sample code 2. See the essen...
In the past, it was quite troublesome to achieve ...
As an entry-level Linux user, I have used simple ...
Nested use of MySQL ifnull I searched online to s...
Preface I looked at the previously published arti...
In this article, we will learn about the optimiza...
Make a note so you can come back and check it lat...
The detailed installation and configuration of th...
Preface Recently I encountered a requirement, whi...
Preface This article uses the new features of MyS...
Table of contents background Achieve a similar ef...