MySQL storage engine Selection

Source: Internet
Author: User

1.1 MySQL storage engine Overview

MySQL supports multiple storage engines. When processing different types of applications, you can select different storage engines to improve application efficiency or provide flexible storage.

Including MyISAM, InnoDB, bdb, memory, merge, example, NDB cluster, archive, and CSV. Among them, InnoDB and bdb provide security transaction tables, and other engines are non-transaction security tables.

 

1.2 features of various storage engines

Features

MyISAM

Bdb

Memory

InnoDB

Archive

Storage restrictions

No

No

Yes

64 TB

No

Transaction Security

 

Supported

 

Supported

 

Lock Mechanism

Table lock

Page lock

Table lock

Row lock

Row lock

B-Tree Index

Supported

Supported

Supported

Supported

 

Hash Index

 

 

Supported

Supported

 

Full-text index

Supported

 

 

 

 

Cluster Index

 

 

 

Supported

 

Data Cache

 

 

 

Supported

 

Index Cache

 

 

Supported

Supported

 

Data Compression

Supported

 

 

 

Supported

Space usage

Low

Low

No space consumption

High

Low

Memory usage

Low

Low

Moderate

High

Very high

Batch insert speed

High

High

High

Low

Very high

Supports Foreign keys

 

 

 

Supported

 

 

The most common storage engine:

1.
MyISAM storage engine: Each MyISAM is stored as three files on the disk. The file names are the same as the table names. The extensions are. frm (storage table definition),. MYD (storage data), and. myi (storage index ). Data Files and index files can be placed in different directories, and I/O is evenly distributed to achieve faster speed.

2.
InnoDB Storage engine: Provides transaction security capabilities such as commit, rollback, and crash recovery. Compared with MyISAM, InnoDB has a lower write efficiency and occupies more disk space to retain data and indexes.

 

1.3
How to select an appropriate engine

The following is the applicable environment for common storage engines:

1.
MyISAM: it is the most commonly used storage engine in Web, data warehousing, and other application environments.

2.
InnoDB: used for transaction processing applications, with more features, including ACID transaction features.

3.
Memory: all data is stored in Ram and can be accessed quickly when you need to quickly search for references and other similar data environments.

4.
Merge: Allows MySQL DBA (Database Administrator) or developers to logically combine a series of equivalent MyISAM tables and reference them as one object. Suitable for world warehousing and other environments.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.