MySQL 可插拔存储引擎是 MySQL 数据库服务器中的一个组件,负责执行数据库的实际数据 I/O 操作,同时启用和执行针对特定应用需求的某些功能集。使用特定存储引擎的一个主要好处是,您只会获得特定应用所需的功能,因此数据库的系统开销更小,最终结果是更高效、更高性能的数据库。这也是 MySQL 一直以高性能著称的原因之一,在行业标准基准测试中,其性能可以匹配甚至超过专有的单体数据库。A MySQL pluggable storage engine is the component in the MySQL database server that is responsible for performing the actual data I/O operations for a database as well as enabling and enforcing certain feature sets that target a specific application need. A major benefit of using specific storage engines is that you are only delivered the features needed for a particular application, and therefore you have less system overhead in the database, with the end result being more efficient and higher database performance. This is one of the reasons that MySQL has always been known to have such high performance, matching or beating proprietary monolithic databases in industry standard benchmarks.
从技术角度来看,存储引擎中有哪些独特的支持基础设施组件?一些关键的功能差异包括:From a technical perspective, what are some of the unique supporting infrastructure components that are in a storage engine? Some of the key feature differentiations include:
并发性:某些应用程序的锁需求比其他应用程序更细粒度(例如行级锁)。选择正确的锁策略可以减少开销,从而提高整体性能。这一领域还包括对多版本并发控制或“快照”读取等功能的支持。Concurrency: Some applications have more granular lock requirements (such as row-level locks) than others. Choosing the right locking strategy can reduce overhead and therefore improve overall performance. This area also includes support for capabilities such as multi-version concurrency control or “snapshot” read.
事务支持:并非每个应用程序都需要事务,但对于需要事务的应用程序,有非常明确的要求,例如 ACID 合规性等。Transaction Support: Not every application needs transactions, but for those that do, there are very well defined requirements such as ACID compliance and more.
参照完整性:需要通过 DDL 定义的外键让服务器强制执行关系数据库的参照完整性。Referential Integrity: The need to have the server enforce relational database referential integrity through DDL defined foreign keys.
物理存储:这涉及从表和索引的整体页面大小到用于将数据存储到物理磁盘的格式的所有内容。Physical Storage: This involves everything from the overall page size for tables and indexes as well as the format used for storing data to physical disk.
索引支持:不同的应用场景往往受益于不同的索引策略。每种存储引擎通常都有自己的索引方法,尽管有些(如 B 树索引)几乎所有引擎都通用。Index Support: Different application scenarios tend to benefit from different index strategies. Each storage engine generally has its own indexing methods, although some (such as B-tree indexes) are common to nearly all engines.
内存缓存:不同的应用对某些内存缓存策略的响应优于其他策略,因此,虽然有些内存缓存(如用于用户连接的缓存)在所有存储引擎中都是通用的,但其他缓存则仅在特定存储引擎启用时才会定义。Memory Caches: Different applications respond better to some memory caching strategies than others, so although some memory caches are common to all storage engines (such as those used for user connections), others are uniquely defined only when a particular storage engine is put in play.
性能辅助:这包括用于并行操作的多个 I/O 线程、线程并发性、数据库检查点、批量插入处理等等。Performance Aids: This includes multiple I/O threads for parallel operations, thread concurrency, database checkpointing, bulk insert handling, and more.
杂项目标功能:这可能包括对地理空间操作的支持,对某些数据操作的安全限制,以及其他类似功能。Miscellaneous Target Features: This may include support for geospatial operations, security restrictions for certain data manipulation operations, and other similar features.
每一组可插拔存储引擎基础架构组件都旨在为特定应用提供选择性的好处。相反,避免使用某些组件功能可以帮助减少不必要的开销。很明显,理解特定应用的需求集合并选择合适的 MySQL 存储引擎,可以对整体系统效率和性能产生显著影响。Each set of the pluggable storage engine infrastructure components are designed to offer a selective set of benefits for a particular application. Conversely, avoiding a set of component features helps reduce unnecessary overhead. It stands to reason that understanding a particular application's set of requirements and selecting the proper MySQL storage engine can have a dramatic impact on overall system efficiency and performance.