1. MySQL storage engine architecture and --MySQL architecture, storage engine

A, MySQL storage engine architecture and

While various different platforms at the bottom (e.g., threads) implementing aspects of, but substantially MySQL ensures consistency in the physical structure of the various platforms. Therefore, the user should be able to very good understanding of MySQL database in all of these platforms is how it works.

1.1 Definitions and examples of database

Database: A collection of physical operating system files or other forms of file types. In the MySQL database, the database file can be frm, myd, myi, ibd file. NDB engine, is stored in a file in memory, but the definition unchanged.

Examples: MySQL database by a background thread and a shared memory region. Shared memory may be running background thread shared. In the case of clusters, there may be a case where a plurality of database data to be used by the examples.

Conceptually, the database is a collection of files, is organized and stored in two data sets in the memory according to some data model.

Program database instance is situated between the user and the operating system layer data management software, any user operation on the data in the database, the database comprising definitions, data query, data maintenance, the database control operation are carried out in the database instance The application can only interact with the database through the database instance.

 

MySQL is a single process multi-threaded architecture of the database.

MySQL database in accordance /etc/my.cnf -> /etc/myssql/my.cnf -> /usr/local/mysql/etc/my.cnf -> ~ / read sequence .my.cnf profile.

If you have the same number of parameters in the configuration file, MySQL database to finally read a configuration file parameters prevail.

1.2 MySQL architecture

 

 The figure shows, MySQL from the following components:

  • Connectivity Pool Component
  • Management services and tool components
  • SQL interface components
  • Query Analyzer component
  • Optimizer component
  • Buffer (Cache) component
  • Pluggable storage engine
  • Physical file

MySQL is different from the other most important feature of a database table is a plug-in storage engine, noted that the storage engine is based on the table.

1.3 MySQL storage engine

1.3.1 InnoDB storage engine

  It is designed primarily for applications online transaction processing (OLTP) a. It features support for transactions, row lock design, support for foreign keys, unlocked reading (MVCC, which is the default read operation will not lock). After MySQL5.5.8, InnoDB is the default storage engine.

  InnoDB is obtained through the use of highly concurrent multi-version concurrency control (MVCC), and to achieve four levels of isolation, the default level is REPEATABLE

  The use of next-key locking strategies to avoid the phenomenon of phantom read

  Providing the 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

  The data in the table using aggregated (clustered) mode, for storage per table is the primary key in the order, if no primary key in the table definition, InnoDB storage engine will generate a 6-byte ROWID for each row, and as the primary key.

1.3.2 MyISAM storage engine

  It does not support transactions, table locks designed to support full-text indexing, mainly for OLAP applications

  Before the default storage engine of MySQL 5.5.8

  Buffer pool cache only the index files are not cached data files. Data files be done by the operating system itself

1.3.3 NDB storage engine data

  Omission

 

Problem: When the data table is greater than 10 million, MySQL performance would drop dramatically it?

As the number of rows, the performance will decline, but the decline is not linear, if the user selects the correct storage engine, the correct configuration, no matter how much the amount of data MySQL can afford. As mentioned official manual, 1TB of data exceeds the storage InnoDB processing insert, update average operation 800 times / sec.

 

  

 

 

 

Guess you like

Origin www.cnblogs.com/jjfan0327/p/12660045.html