MySQL8.0 引擎的底层架构 的简单了解
用了两年MySQL,还不知道它的底层原理,所以今天就大概了解一下。
原文地址:https://dev.mysql.com/doc/refman/8.0/en/pluggable-storage-overview.html
The MySQL pluggable storage engine architecture enables a database professional to select a specialized storage engine for a particular application need while being completely shielded from the need to manage any specific application coding requirements.
MySQL可插拔存储引擎体系结构使数据库专业人员能够为特定的应用程序需求选择专门的存储引擎,同时完全不需要管理任何特定的应用程序编码需求。
The MySQL server architecture isolates the application programmer and DBA from all of the low-level implementation details at the storage level, providing a consistent and easy application model and API.
MySQL服务器体系结构将应用程序程序员和DBA与存储层的所有低层实现细节隔离开来,提供了一致且简单的应用程序模型和API。
Thus, although there are different capabilities across different storage engines, the application is shielded from these differences.
因此,尽管不同的存储引擎具有不同的功能,但应用程序不会受到这些差异的影响。
The MySQL pluggable storage engine architecture is shown in Figure 16.3, “MySQL Architecture with Pluggable Storage Engines”.
MySQL可插拔存储引擎架构下图所示,“具有可插拔存储引擎的MySQL架构”。
The pluggable storage engine architecture provides a standard set of management and support services that are common among all underlying storage engines.
可插拔存储引擎体系结构提供了一套标准的管理和支持服务,这些服务在所有底层存储引擎中都是通用的。
The storage engines themselves are the components of the database server that actually perform actions on the underlying data that is maintained at the physical server level.
存储引擎本身是数据库服务器的组件,它们实际上对在物理服务器级别上维护的底层数据执行操作。
This efficient and modular architecture provides huge benefits for those wishing to specifically target a particular application need—such as data warehousing, transaction processing, or high availability situations—while enjoying the advantage of utilizing a set of interfaces and services that are independent of any one storage engine.
这种高效和模块化的体系结构为那些希望专门针对特定应用程序需求的用户(如数据仓库、事务处理或高可用性情况)提供了巨大的好处,同时还利用了一组独立于任何存储引擎的接口和服务。
The application programmer and DBA interact with the MySQL database through Connector APIs and service layers that are above the storage engines.
应用程序程序员和DBA通过存储引擎之上的连接器api和服务层与MySQL数据库交互。
If application changes bring about requirements that demand the underlying storage engine change, or that one or more storage engines be added to support new needs, no significant coding or process changes are required to make things work.
如果应用程序更改带来了要求更改底层存储引擎的需求,或者需要添加一个或多个存储引擎来支持新的需求,则不需要进行重大编码或流程更改就可以工作。
The MySQL server architecture shields the application from the underlying complexity of the storage engine by presenting a consistent and easy-to-use API that applies across storage engines.
MySQL服务器体系结构通过提供一致的、易于使用的、跨存储引擎应用的API,使应用程序免受存储引擎底层复杂性的影响。
到这里,它原文介绍就结束了,我们再来看一下这个图
首先上面的是MySQL连接器和MySQL的shell,他们可以发送代码到服务层。
服务层里包含SQL接口,NoSQL接口,他们是用来处理结构化查询语言和非结构化查询语言的组件
还有Parser解析器,Optimizer优化器,缓存等模块。
再往下就是支持这些模块的底层实现,MySQL的核心存储模块
它是由经典的InnoDB,MyISAM,NDB 集群,内存等等组合而成的,它也负责索引的管理。
最后就是支持引擎运行的平台文件系统,还有运行的产出文件和日志。