Dry: Daniel Ali On MySQL system architecture

One: the database and the database instance

 In the study and research of MySQL, there are very easy to confuse the two concepts, namely the database and the database instance. In MySQL, databases and database instance is defined as follows:

Database: storing a set of data;

Database instance: the set of database operations.

Clearly, as defined above, and is used to store data in the database, the database instance is used to manipulate the data, from the perspective of the operating system, the performance of a process instance database, corresponding to a plurality of threads,

In a non-clustered database schema, the presence of one relationship database and database instance, database cluster, there may be multiple instances operating a database where the database, i.e., a foreign key.

Two: MySQL pedestal

 For MySQL, although experienced multiple versions of iterations (MySQL5.5, MySQL 5.6, MySQL 5.7, MySQL 8), but each iteration, are based on MySQL

The base frame, MySQL base frame assembly generally includes several modules as follows:

(1) interactive interface (Connectors) MySQL outwardly provided

(2) Management Services components and tool components (Management Service & Utilities)

(3) connection pooling assembly (Connection Pool)

(4) SQL interface component (SQL Interface)

(5) Query parser component (Parser)

(6) optimizer component (Optimizer)

(7) main assembly cache (Caches & Buffers)

(8) pluggable storage engine (Pluggable Storage Engines)

(9) the physical file (File System)


webp

(A) the interactive interface provides the MySQL outwardly (Connectors)

Connectors assembly, is provided outwardly MySQL interaction component, such as java, .net, php language like SQL statements may be through the assembly, interact with the SQL.

(B) Management Services components and tool components (Management Service & Utilities)

Provides integrated management for MySQL, such as backup (Backup), recovery (Recovery), Security Management (Security), etc.

(C) connection pooling assembly (Connection Pool)

Responsible for monitoring client requests to the various MySQL Server side, receives the request, forwarding the request to the target module. Each client successfully connect MySQL Server requests will be

Create or assign a thread, the thread is responsible for communication with MySQL Server client side, to receive commands sent by the client, deliver results and other information services side.

(Iv) SQL interface components (SQL Interface)

Receiving a user SQL commands such as DML, DDL, and stored procedures, and the final result back to the user.

(V) component Query Analyzer (Parser)

Firstly, legality SQL command syntax, SQL commands and try to break down into a data structure, if the decomposition fails, prompt the SQL statement is unreasonable.

(F) Optimization assembly (Optimizer)

SQL commands are optimized for analysis in accordance with standard procedures.

(Vii) the main pieces of cache (Caches & Buffers)

Cache and buffer components

(Viii) MySQL storage engine

1. What is a MySQL storage engine

MySQL belongs to the relational database, in the form of a relational database table storage is carried out, for table creation, data storage, retrieval, update, etc. are made MySQL

Complete storage engine, which is the MySQL storage engine in MySQL plays an important role.

SQL Server and Oracle studied the reader might very clear that these two database storage engine is only one, and MySQL storage engine more species, such as MyISAM storage

Engine, InnoDB storage engine and Memory storage engine.

There are many reason why MySQL storage engines, because of the open source nature of MySQL decision. MySQL storage engine, from the species, it can be broadly attributed to the official and the third storage engine

Party storage cause. MySQL open-source, allowing third-party MySQL-based framework to develop storage engines for your business needs.

2.MySQL storage engine role

MySQL storage engine in MySQL play an important role, as its more important role, generally attributed to the following two aspects:

A role: management table creation, data retrieval, index creation, etc.

Role two: meet custom storage engine development.

3.MySQL engine category

Different types of storage engine, the storage engine tables stored in the table mechanism is also different from the kind of MySQL storage engine, the storage engine can be divided into official and third-party storage engine.

Currently, there are a variety of MySQL storage engines such as MyISAM storage engine, InnoDB storage engine, NDB storage engine, Archive storage engine, Federated storage engine, Memory

Storage engine, Merge storage engine, Parter storage engine, Community storage engine, Custom storage engines and other storage engines.

Wherein the commonly used storage engine include InnoDB storage engine, and the engine Momery storage MyISAM storage engine.

4. Comparison of typical storage engine MySQL

webp

(Ix) the physical file (File System)

MySQL database to store the actual files and some log files and other systems, such as Linux, Unix, Windows and so on.

Three: a flow chart query


webp


Guess you like

Origin blog.51cto.com/13689432/2414551