[MySQL multiple storage engines]

1. MySQL multiple storage engines:

MyISAM、InnoDB、MERGE、MEMORY(HEAP)、BDB(BerkeleyDB)、EXAMPLE、FEDERATED、ARCHIVE、CSV、BLACKHOLE。

 

MySQL supports several storage engines as handlers for different table types. The MySQL storage engine includes an engine that handles transaction-safe tables and an engine that handles non-transaction-safe tables:

MyISAM manages non-transactional tables. It provides high-speed storage and retrieval, as well as full-text search capabilities. MyISAM is supported in all MySQL configurations and is the default MySQL storage engine unless you configure MySQL to use another engine by default.

The MEMORY storage engine provides "in-memory" tables. The MERGE storage engine allows a collection to be treated with the same MyISAM table as a single table. Just like MyISAM, the MEMORY and MERGE storage engines handle non-transactional tables, and both are included by default in MySQL.

NOTE: The MEMORY storage engine is officially identified as the HEAP engine.

InnoDB and BDB storage engines provide transaction-safe tables. BDB is included in the MySQL-Max binary distribution for operating systems that support it. InnoDB is also included by default in all MySQL 5.1 binary distributions, and you can configure MySQL to enable or disable either engine as you like.

The EXAMPLE storage engine is a "stub" engine that does nothing. You can create tables with this engine, but no data is stored in or retrieved from it. The purpose of this engine is to serve, an example in the MySQL source code, which demonstrates how to start writing a new storage engine. Again, its main interest is to developers.

NDB Cluster is the storage engine used by MySQL Cluster to implement tables that are partitioned across multiple computers. It is provided in the MySQL-Max 5.1 binary distribution. This storage engine is currently only supported by Linux, Solaris, and Mac OS X. In future MySQL distributions, we want to add support for this engine on other platforms, including Windows.

The ARCHIVE storage engine is used to cover large amounts of data stored in very small amounts without indexes.

The CSV storage engine stores data in a comma-separated format in a text file.

The BLACKHOLE storage engine accepts but does not store data, and retrieval always returns an empty set.

The FEDERATED storage engine stores data in a remote database. In MySQL 5.1, it only works with MySQL, using the MySQL C Client API. In a future distribution, we would like to have it connect to another data source using other driver or client connection methods.

When you create a new table, you can tell MySQL what type of table you want to create by adding an ENGINE or TYPE option to the CREATE TABLE statement:

 

CREATE TABLE t (i INT) ENGINE = INNODB;  CREATE TABLE t (i INT) TYPE = MEMORY; 

 

TYPE is still supported in MySQL 5.1 and ENGINE is now the preferred term.

 

2. How to choose the most suitable storage engine for you?

The following storage engines are the most commonly used:

MyISAM: The default MySQL plug-in storage engine, which is one of the most commonly used MySQL storage engines in Web, data warehousing and other application environments. Note that the default storage engine of the MySQL server can be easily changed by changing the STORAGE_ENGINE configuration variable.

InnoDB: For transaction processing applications, with numerous features, including ACID transaction support.

BDB: An alternative transaction engine for InnoDB, supporting COMMIT, ROLLBACK and other transaction features.

Memory: Keeps all data in RAM, providing extremely fast access in environments where you need to quickly look up references and other similar data.

Merge: Allows a MySQL DBA or developer to logically group together a series of equivalent MyISAM tables and reference them as 1 object. Ideal for VLDB environments such as data warehousing.

Archive: Provides the perfect solution for storing and retrieving large amounts of rarely referenced historical, archive, or security audit information.

Federated: Ability to link multiple separate MySQL servers to create a single logical database from multiple physical servers. Ideal for distributed environments or data mart environments.

Cluster/NDB: MySQL's cluster database engine, especially suitable for applications with high-performance lookup requirements that also require the highest uptime and availability.

Other: Other storage engines include CSV (quoting comma-separated files used as database tables), Blackhole (for temporarily suppressing application input to the database), and the Example engine (for quick creation of custom plug-in storage engines) provide help).

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326944846&siteId=291194637