MYSQL engine logical architecture

The following figure shows the logical architecture of MYSQL

1. Client layer

Client services are not unique to mysql, most web-based client/server tools have them. Each client connection has a thread in the server process, and queries for that connection are executed only in that thread. The server caches this thread, so there is no need to create and destroy connections for each connection (the application of thread pools).

2. The service layer

The second layer contains most of MYSQL’s functions, including parsing, optimization, caching, and all built-in functions, views, stored procedures, and triggers

3. Storage engine layer

The storage engine layer is responsible for data storage and extraction, and data is stored in file form. The various storage engines have their advantages and disadvantages. The selection of a storage engine is similar to the selection of a file storage type (PARQUET,ORC, etc.) in HIVE. In MYSQL, the main storage engine includes INNODB(default), MYISAM, etc. INNODB is suitable for most scenarios.