Get the App
SLTechnology News&Howtos  ›  Database  › 

What are the layers of mysql logical architecture

Shulou Source: shulou.com Published: 2022-05-31 13:59:09 09月17日 Update

This article introduces the relevant knowledge of "how many layers are there in the logical architecture of mysql". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

The first layer, the service layer (for client services): do connection processing for requests, authorization authentication, security, etc.

1. The query for each connection is completed on a thread in a process.

two。 The server is responsible for caching threads, so the service layer does not need to create a new thread for each connection.

Note: mysql5.5 or newer versions provide an API that supports the thread pool (thread-pooling) plug-in, which can use a small number of threads in the pool to serve a large number of connections. (similar to the shared connection method in oracle)

The second layer, core layer: query parsing, analysis, optimization, caching, providing built-in functions; stored procedures, triggers, views.

1. The optimizer does not care what storage engine is used, but the storage engine has an impact on optimizing queries.

two。 Before parsing the query, the server "asks" if the query is cached (only SELECT statements and corresponding results can be cached). The cached results are returned directly, while the uncached ones need to parse the query, optimize, and re-execute the returned results.

3. An internal data structure (parsing tree) is created when the query is parsed, and then various optimizations are made.

The third layer, the storage engine layer, not only stores and extracts data, but also does transaction processing for special data engines.

1. The server communicates with the storage engine through API, and the interface shields the differences between different storage engines, which makes the upper layer query transparent.

two。 There is no communication between different storage engines, only simple requests for upper-layer services.

This is the end of the content of "how many layers of mysql logical architecture". Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Tags: Storage service query engine cache thread data server result architecture logic different upper layer between content more knowledge process processing communication Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Apple MariaDB MySQL Shulou Technology Linux