This is the fifth day of my participation in the November Gwen Challenge. Check out the details: The last Gwen Challenge 2021

I. Overall architecture diagram

MySql’s advantage over other databases is that its architecture can be used in many different scenarios and can work well.

This is mainly reflected in the engine layer, MySql engine is pluggable, business processing and engine are separated, so you can choose different engines to process according to different business requirements, even the existing engine does not meet your needs, you can customize MySql engine.

Ii. Introduction to each layer of the architecture

2.1. Connection Layer

It mainly completes some processing similar to connection processing, authorization authentication, and related security schemes, including local SOCK communication and most communication similar to TCP/IP based on client/server tools.

The concept of a thread pool is to provide threads for clients that have passed security authentication.

2.2. Service Layer

The service layer is also commonly called the logical processing layer. The service layer mainly contains the following points:

Component name explain
Management Serveices & Utilities System management and control tools
SQL Interface SQL interface. Accepts the user’s SQL command and returns the result that the user needs to query. For example, select from calls SQL Interface.
Parser SQL parsers. SQL commands passed to the parser are validated and parsed by the parser.
Optimizer SQL query optimizer. SQL statements use the query optimizer to optimize the query before it is queried, such as when there is a WHERE condition, and the optimizer decides whether to cast or filter first.
Cache & Buffer SQL query cache. If the query cache has a matching query result, the query statement can directly fetch data from the query cache. This caching mechanism consists of a series of small caches. Such as table cache, record cache, key cache, permission cache and so on

2.3. Engine Layer

Storage engine layer, storage engine is really responsible for the storage and extraction of data in MySQL, server through API communication with storage engine. Because the MySql engine is pluggable, we can choose different engines according to different business scenarios.

Custom storage engines are also described on the mysql website. Write a custom storage engine

2.4. Data Storage Layer

This is what we normally call physical storage, which basically stores data to the file system on the server running mysql, and can complete the interaction with the storage engine.

later

Step pit today has not written out, first send a draft, tomorrow to continue liver.

The paper come zhongjue shallow, and must know this to practice.

Hello everyone, I am ning Zaichun: homepage

A young man who likes literature and art but takes the path of programming.

Hope: by the time we meet on another day, we will have achieved something.

Learning video: B station Zhou Yang teacher MySQL advanced