In this article, we look at MySQL storage engines.
Storage Engines
In MySQL, the storage engine is responsible for actually storing data on disk storage and reading it back.

As shown in the figure above, MySQL uses storage engines as plugins, so you can configure and use whichever storage engine you need.
You can list storage engines with the
show [storage] engines command. The Support values mean the following.Value | Description |
DEFAULT | Available (=YES) and the current default storage engine |
YES | Available storage engine |
NO | Storage engine not included |
DISABLED | Storage engine included but disabled |
- Unlike the MySQL engine, multiple storage engines can be used at the same time. Once you specify the storage engine for a table, that storage engine handles all subsequent reads and writes on the table.
- Performance can differ depending on which storage engine you use. Each storage engine processes work differently, which is why choosing a storage engine matters a great deal.
- To use a storage engine not included in MySQL Server, you have to rebuild the MySQL server. Storage engines built and shipped as plugins, however, can be added, used, and upgraded easily by downloading the library.
Types of Storage Engines
The storage engines provided as plugins in MySQL 8.0 are as follows.
InnoDB
First, the InnoDB engine. InnoDB is the default storage engine in MySQL 8.0 and the most widely used. (Its architecture is the closest to Oracle's.)

Features
- With InnoDB, DML operations follow the ACID model and protect data with transactions that support commit, rollback, and recovery.
📢 ACID stands for Atomicity, Consistency, Isolation, and Durability. These are properties of transactions in a database that guarantee data validity.
- The core feature of InnoDB is the buffer pool. Like Oracle's buffer cache, it is a space for caching data files and index information from disk in memory. Because it batches changed data, it can reduce the number of disk I/O operations.
- Data is stored on disk sorted to optimize queries based on the PK (primary key). A primary key index called the clustered index minimizes I/O for PK lookups.
- Provides concurrency for multiple users with row-level locks and MVCC.
📢 MVCC (Multi Version Concurrency Control) is a mechanism that prevents conflicts when data is both modified and read, and guarantees each session a consistent view of the data as of the time it writes or reads it. It manages multiple versions of a single record: regardless of whether a transaction commits or rolls back, MySQL writes the pre-change data to the undo log, so data can be read consistently without locks, depending on the isolation level.
- Supports FKs (foreign keys) to guarantee data integrity. When you split related data into another table, you can set an FK for referential integrity.
- Automatically detects deadlocks and resolves them by rolling back the transaction that changed the fewest records.
MyISAM
The MyISAM engine is simpler and faster than InnoDB, but concurrency control is difficult. (It was the default storage engine before MySQL 5.5.)
Features
- Provides several useful features such as full-text indexing, compression, and functions (Geographic Information System, GIS).
- Does not support transactions.
- There is a memory area called the key cache (which plays a role similar to InnoDB's buffer pool); it is an area preallocated to store indexes of MyISAM tables. Because the key cache works on indexes, it partly acts as a buffer for index writes to disk. Table data has no caching or buffering, so it always goes to disk.
- Provides table-level locks rather than row-level locks; reading and writing any table requires acquiring a shared read lock or an exclusive write lock.
- Supports concurrent inserts, so it suits batch jobs that perform large numbers of inserts.
- Suited to read-only or read-heavy workloads, and mainly used in DW environments with many read queries.
MEMORY(Heap)
A storage engine that stores data in memory, with much higher I/O efficiency than other engines.
Features
- Uses table-level locks.
- Because data is stored in memory, it is generally very fast, but data can be lost. (The table definition is stored in the MySQL data dictionary, and no file is created on disk.)
- Often used for temporary tables that are less critical but need fast processing.
- The MEMORY engine is used in the following cases.
- Data lookups or mapping
- Caching the results of periodically aggregated data
- Storing intermediate results during data analysis
ARCHIVE
A storage engine that compresses and stores large volumes of data.
Features
- Each row is compressed with zlib as it is inserted, so it generates far less disk I/O and handles inserts quickly.
- Allows Insert, Replace, and Select, but does not allow Delete or Update queries.
- Uses row-level locks.
- Mainly used to store and read large amounts of log-type data.
- Does not support indexes.
CSV(Comma Separated Values)
A storage engine that stores data in text files using the comma-separated values format.
Features
- All columns in tables created with the CSV storage engine have the NOT NULL attribute.
- Files can be copied into and out of the database while the server is running.
- CSV files integrate easily with most applications, which provides flexibility.
- (e.g. if you export a CSV file from a spreadsheet and save it in the MySQL Server data directory, the server can read the file immediately, and data written to a CSV table can be viewed with external programs.)
FEDERATED
A storage engine that links separate physical MySQL servers into one logical MySQL database; recommended especially for distributed data environments.

Features
- A FEDERATED table consists of two elements.
- Remote Server : holds the table definition and data. The remote table can use any type of storage engine supported by the remote server, including MyISAM or InnoDB.
- Local Server : needs a table that matches the table definition on the remote server, and unlike the remote server, the table must use the Federated engine. The local server has no actual data files; the table definition contains connection information pointing to the remote table.
- Querying a Federated table on the local server references the table on the remote server, and all operations connect to the remote server.
- No actual data is stored in the local table.
- When you run queries and commands on a Federated table on the local server, operations such as Insert, Update, or Delete are sent to the remote server, which updates its data files or returns matching rows.
📢 Because access to Federated table data is handled remotely, indexes are used on the actual remote table. If no index can be used and a full table search is needed, all rows are fetched from the remote table and filtered on the local server, which can cause performance degradation and network load. (The returned results must be stored in memory, which can lead to swapping or hanging on the local server.)
BLACKHOLE
A storage engine with no storage mechanism at all: it accepts data but discards it without storing it.
Features
- Data inserted into a Blackhole table is not stored, and searches always return an empty result.
- Creating a Blackhole table only creates the table definition; no file is associated with the table.
- In a replication environment, if a Blackhole table exists on the master server,
binlog_formatmust be set tostatement. (Ifbinlog_formatismixedorrow, changes are not applied to the slave table.)
- The BLACKHOLE engine is used in the following cases.
- Checking the syntax of dump files
- Measuring binlog overhead by comparing performance with binary logging enabled and disabled
- Finding performance bottlenecks unrelated to the storage engine itself
NDB(For MySQL Cluster)
Also called the cluster DB, it is the storage engine used to build MySQL Cluster.
MySQL NDB Cluster = MySQL Server + NDB Storage Engine
NDB Cluster (Network Database Cluster) is a technology that enables clustering of in-memory databases in a shared-nothing system. It handles clustering in processes (nodes) separate from MySQL, and when users access the cluster through custom clients (NDBAPI), it can be used independently of MySQL Server.
- Data Nodes : store data and perform the main query work
- SQL Nodes : execute queries (=MySQL Server instances)
- Management Server : manages cluster configuration, handles new connections, and creates backups on node failure
📢 Shared-nothing literally means "nothing is shared": all resources other than the network are separated. In a shared-nothing system, each component must have its own memory and disk. Shared storage mechanisms such as network shares, network file systems, and SANs are not recommended or not supported.

Features
- A clustered database engine is especially suited to applications that need the highest possible uptime and availability.
- When data is stored by the NDB storage engine, tables (and table data) are stored on data nodes. These tables can be accessed directly from all other MySQL servers (SQL nodes) in the cluster.
- MySQL servers not connected to the NDB cluster cannot use the NDB storage engine and cannot access NDB cluster data.
MRG_MyISAM
Also called the MERGE engine, it treats a collection of identical MyISAM tables as one logical unit so they can be queried together. The results returned from multiple tables are the same as those returned from one table.
"Identical" MyISAM tables means all tables have the same column data types and index information.
When you create a Merge table, MySQL creates a .MRG file on disk that contains the names of the underlying MyISAM tables. The table format of the Merge table is stored in the MySQL data dictionary.
Features
- MyISAM tables whose columns are listed in a different order, whose columns do not have the same data types, or whose indexes are in a different order cannot be merged.
- You can use Select, Delete, Update, and Insert on a Merge table only if you have privileges on the MyISAM tables mapped to the MERGE table.
- Makes large data sets such as log tables easy to manage, and processing is fast. (Splitting a large table into several tables stored on different disks and accessing them through a Merge table is faster than processing one large table.)
- Maps multiple tables into one table instantly. A Merge table uses the indexes of the individual tables and does not need to maintain its own, so creating or remapping a collection of Merge tables is very fast.
- The downside is slow index reads. (When reading an index, the Merge storage engine must read all underlying tables to find the one that most closely matches the given key.)
Summary of Major Storage Engine Features
Feature | MyISAM | Memory | InnoDB | Archive | NDB |
B-tree indexes | Yes | Yes | Yes | No | No |
Backup/point-in-time recovery (note 1) | Yes | Yes | Yes | Yes | Yes |
Cluster database support | No | No | No | No | Yes |
Clustered indexes | No | No | Yes | No | No |
Compressed data | Yes (note 2) | No | Yes | Yes | No |
Data caches | No | N/A | Yes | No | Yes |
Encrypted data | Yes (note 3) | Yes | Yes (note 4) | Yes (note 3) | Yes (note 3) |
Foreign key support | No | No | Yes | No | Yes (note 5) |
Full-text search indexes | Yes | No | Yes (note 6) | No | No |
Geospatial data type support | Yes | No | Yes | Yes | Yes |
Geospatial indexing support | Yes | No | Yes (note 7) | No | No |
Hash indexes | No | Yes | No (note 8) | No | Yes |
Index caches | Yes | N/A | Yes | No | Yes |
Locking granularity | Table | Table | Row | Row | Row |
MVCC | No | No | Yes | No | No |
Replication support (note 1) | Yes | Limited (note 9) | Yes | Yes | Yes |
Storage limits | 256TB | RAM | 64TB | None | 384EB |
T-tree indexes | No | No | No | No | Yes |
Transactions | No | No | Yes | No | Yes |
Update statistics for data dictionary | Yes | Yes | Yes | Yes | Yes |
Notes:
- Implemented in the server, not in the storage engine.
- Compressed MyISAM tables are supported only when using the compressed row format. MyISAM tables using the compressed row format are read-only.
- Implemented in the server through encryption functions.
- Implemented in the server through encryption functions. (MySQL 5.7 and later support data-at-rest encryption.)
- Foreign key support is available in MySQL Cluster NDB 7.3 and later.
- Full-text index support is available in MySQL 5.6 and later.
- Geospatial indexing support is available in MySQL 5.7 and later.
- InnoDB uses hash indexes internally for its adaptive hash index feature.
- The MEMORY storage engine has limited replication support.
- When a replication source server is shut down and restarted, its MEMORY tables become empty.
- The first time the source server uses a given MEMORY table after startup, it writes a Delete or Truncate table statement for that table to the binary log, recording an event that tells replicas to empty the table.
- When a replication server is shut down and restarted, its MEMORY tables are also emptied, and it writes a Delete or Truncate table statement to its own binary log, which is then passed on to its replicas.
Related Articles
