[] MySQL storage engine --2019-08-17 02:28:42

Original: http://blog.gqylpy.com/gqy/245

"


table of Contents

#. MySQL storage engine support

1. InnoDB

2. MyISAM

3. NDB

4. Memory

5. Infobright

6. SMART

7. BLACKHOLE


MySQL database that is in the folder, the file list that is
real life we used to store data files of different types, each file type corresponding to each different mechanisms (such as: text with txt type of treatment, treatment table with excel , with pictures by png, etc.)

Table in the database should have different types, the different types of tables, mysql may correspond to different access mechanisms, also known as type table storage engine.

PS: storage engine that white is how to store data, how to index data stored and how to update, query data and other implementation technologies. In a relational database because the data stored in the form of a table is stored, the storage engine may also be referred to as a table type (i.e., type of operation and store this table)

In Oracle and SQL Server database storage engine is only one, all database storage management mechanisms are the same, and the MySQL database engine provides a variety of storage, users can according to different needs for different data selection table storage engine, user You can also write your own storage engines according to their needs.

! [Insert Picture description here] (http://blog.gqylpy.com/media/ai/2019-03/f065e887-be54-4608-a236-c400c1478427.png)

SQL interpreter, SQL optimizer, pool, storage engines and other components are present in every database, but not so much for each database storage engine. MySQL's pluggable storage engine that allows developers to design their storage engine layer of the desired storage layer, for example, some applications need to meet the requirements of affairs, some applications do not need to have a very strong demand for the transaction; some data could hope persistent storage, and some just want to fit in memory, and temporarily provide access to data quickly.


#. MySQL storage engine support


   
   
  1. # 查所有支持的存储引擎
  2. show engines\G;
  3. # 查正在使用的存储引擎
  4. show variables like 'storage_engine%';

1. InnoDB

Support services, designed to target the main application-oriented online transaction processing (OLTP) a .

It features a row lock design, support for foreign keys, and similar support Oracle's non-locking read, which is the default read no lock. Starting MySQL version 5.5.8 is the default storage engine.

InnoDB storage engine data in a logical table space, the table space is like a black box, as managed by the InnoDB storage engine itself, from MySQL 4.1 (including 4.1) version, can each InnoDB storage engine table separately stored in a separate file ibd. In addition, InnoDB storage engine supports raw device (row disk) for the establishment of its table spaces.

InnoDB is obtained by using the multi-version concurrency control (MVCC) high concurrency, and achieve the four kinds of standard SQL isolation level, the default is REPEA TABLE level, while the use of a netx-key locking strategy is called to avoid phantom read ( phantom) to produce phenomena. In addition, InnoDB storage engine also provides a cushioning insert (insert buffer), the secondary write (double write), adaptive hash index (adaptive hash index), pre-read (read ahead) and the availability of high-performance Features.

Data stored in the table, InnoDB storage engine uses aggregation mode (clustered), and each table is sequentially storing the primary key, if not explicitly specified when the primary key table definition, InnoDB storage engine is each row, a 6-byte ROWID, and as a primary key.

InnoDB storage engine is the most commonly used MySQL database engine, Facebook, Google, Yahoo and other companies have successfully demonstrated InnoDB storage engine with high availability, high performance and high scalability, its underlying implementation also need to grasp and understand the accumulation of time and technology. If you want to understand the working principle of the InnoDB storage engine, implementation and application, refer to "MySQL Inside: InnoDB storage engine," a book.

2. MyISAM

It does not support transactions, table locks designed to support full-text indexing, mainly for some of the OLAP database applications.

MyISAM storage engine in MySQL 5.5.8 version before the default engine (except the Windows version). Database system and file system a big difference is that support for transactions , MySAM storage engine does not support transactions, the poor fundamental, it is not difficult to understand.

If the user needs to do transactions in all applications? In the data warehouse, ETL Without these operations, simply by reporting queries need to support transactions do? In addition, another MyISAM storage engine unique is its only buffer pool cache (cache) index files without cache data file, which is most of the databases are not the same.

3. NDB

~? Years, MySQL AB company from Sony Ericsson acquired the NDB storage engine NDB storage engine is a clustered storage engine , similar to Oracle's RAC cluster, but to share everything the result of Oracle RAC is different it is that its structure is the share nothing cluster architecture, it is possible to provide a higher level of high availability.

Features NDB storage engine is all the data in memory (from 5.1 version, can be non-indexed data on disk), so the primary key lookup (primary key lookups) is fast, and the ability to add online data storage node NDB (data node), to linearly increase database performance.
Thus, the NDB storage engine is highly available, high performance, scalable database cluster system, the type of database application is also facing the OLTP.

4. Memory

As its name implies, Memory storage engine data are stored in memory, database restart or crash occurs, the data in the table will disappear. It is ideal for temporary table storage OLTP database applications temporary data, it can be used as OLAP database applications, data warehouse dimension tables, Memory storage engine uses hash indexes by default, instead of the usual familiar B + tree index.

5. Infobright

Third-party storage engine, which is characterized by memory is in columns rather than rows, making it ideal for database applications of OLAP.

6. SMART

NetEase storage engine developed for its internal use , the current version does not support transactions, but provides compression, row-level cache and other features, will be realized in the near future transaction support memory.

7. BLACKHOLE

Black hole storage engine, can be used in standby replication distribution main library

 

There are many other MySQL database storage engine, just above lists some of the most commonly used engine.
If you like, can write their own special engine, which is open source gives us the ability to also open source charm.

 

 



"

Original: http://blog.gqylpy.com/gqy/245

Guess you like

Origin www.cnblogs.com/gqy02/p/11367173.html