Comparison of MySQL database engines

This is a comparison between notable database engines for the MySQL database management system (DBMS). A database engine (or "storage engine") is the underlying software component that a DBMS uses to create, read, update and delete (CRUD) data from a database.

Name Vendor License Transactional Under active development MySQL versions MariaDB versions
Archive Oracle GPL No Yes 5.0 - present 5.1 - present
Aria MariaDB GPL No Yes} None 5.1 - present
Berkeley DB Oracle AGPLv3 Yes No ? - 5.0 None
BLACKHOLE Oracle GPL No Yes 5.0 - present 5.1 - present
CONNECT MariaDB GPL No Yes None 10.0 - present
CSV Oracle GPL No Yes 5.0 - present 5.1 - present
Falcon Oracle GPL Yes No ? None
Federated Oracle GPL ? No 5.0 - present ?
FederatedX MariaDB GPL Yes No None ? - present
InfiniDB Calpont GPL Yes No None None
InnoDB Oracle GPL Yes Yes 3.23 - present 5.1 - present
MEMORY Oracle GPL No Yes 3.23 - present 5.1 - present
Mroonga Groonga Project GPL No Yes None 10.0 - present
MyISAM Oracle GPL No No 3.23 - present 5.1 - present
MyRocks Facebook GPLv2 Yes Yes None 10.2 - present
NDB Oracle GPLv2 Yes Yes ? None
OQGRAPH Oracle GPLv2 No No None 5.2 - present
S3 MariaDB GPL No Yes None 10.5 - present
SEQUENCE MariaDB GPL No Yes None 10.0 - present
Sphinx Sphinx Technologies Inc. GPL No No None 5.2 - present
SPIDER Kentoku Shiba GPL Yes Yes None 10.0 - present
TempTable Oracle GPL No Yes 8.0 - present None
TokuDB Percona Modified GPL Yes No None 5.5 - present
XtraDB Percona GPL Yes Yes None 5.1 - 10.1

Comparison between InnoDB and MyISAMEdit

  1. InnoDB recovers from a crash or other unexpected shutdown by replaying its logs. MyISAM must fully scan and repair or rebuild any indexes or possibly tables which had been updated but not fully flushed to disk. Since the InnoDB approach is approximately fixed time while the MyISAM time grows with the size of the data files, InnoDB offers greater availability as database sizes grow.
  2. InnoDB, with innodb_flush_log_at_trx_commit set to 1, flushes the transaction log after each transaction, greatly improving reliability.[1] MyISAM has to be run on top of a fully journaled filesystem, such as ext4 mounted with data=journal, to provide the same resilience against data file corruption. (The journal can be put on an SSD device for improved MyISAM performance, similarly, the InnoDB log can be placed on a non-journaled filesystem such as ext2 running on an SSD for a similar performance boost. Reliability is not sacrificed in either case.)
  3. InnoDB can be run in a mode where it has lower reliability but in some cases higher performance. Setting innodb_flush_log_at_trx_commit to 0 switches to a mode where transactions are not committed to disk before control is returned to the caller. Instead, disk flushes happen on a timer.[1]
  4. InnoDB automatically groups together multiple concurrent inserts and flushes them to disk at the same time.[2] MyISAM relies on the filesystem block cache for caching reads to the data rows and indexes, while InnoDB does this within the engine itself, combining the row caches with the index caches.[3]
  5. InnoDB will store rows in primary key order if present, else first unique key order. This can be significantly faster if the key is chosen to be good for common operations.[citation needed] If there is no primary key or unique key InnoDB will use an internally generated unique integer key and will physically store records in roughly insert order, as MyISAM does. Alternatively, an autoincrementing primary key field can be used to achieve the same effect.
  6. InnoDB provides updatable LZW compressed page storage for both data and indexes. MyISAM compressed tables can't be updated.[4]
  7. When operating in fully ACID-compliant modes, InnoDB must do a flush to disk at least once per transaction, though it will combine flushes for inserts from multiple connections. For typical hard drives or arrays, this will impose a limit of about 200 update transactions per second. For applications which require higher transaction rates, disk controllers with write caching and battery backup will be required in order to maintain transactional integrity. InnoDB also offers several modes which reduce this effect, naturally leading to a loss of transactional integrity guarantees, though still retaining greater reliability than MyISAM. MyISAM has none of this overhead, but only because it does not support transactions.
  8. MyISAM uses table-level locking on updates and deletes to any existing row, with an option to append new rows instead of taking a lock and inserting them into free space. InnoDB uses row-level locking. For large database applications where many rows are often updated, row-level locking is crucial because a single table-level lock significantly reduces concurrency in the database.
  9. Both InnoDB and MyISAM support full-text search, with InnoDB gaining full-text index support in MySQL 5.6.4,[5] but the results can be notably different.[6]

ReferencesEdit

  1. ^ a b MySQL 5.5 Reference Manual - InnoDB Startup Options and System Variables
  2. ^ "MySQL 5.5 Reference Manual - InnoDB Group Commit". Archived from the original on 2011-11-04. Retrieved 2011-10-08.
  3. ^ "MySQL 5.5 Reference Manual - The InnoDB Storage Engine". Retrieved 28 May 2015.
  4. ^ MySQL 5.5 Reference Manual - myisampack — Generate Compressed, Read-Only MyISAM Tables
  5. ^ "Changes in MySQL 5.6.4 (2011-12-20, Milestone 7)". Oracle. December 12, 2011.
  6. ^ "InnoDB Full-text Search in MySQL 5.6: Part 2, The Queries!". MySQL Performance Blog. March 4, 2013.

External linksEdit