Mysql 内部结构 / Replication | 层次结构

19.1 Chapter Organization

We distinguish between two levels of the architecture: principles, and rules:缓存

principleide

High-level goal that declares how the program shall work, from an external point of view. Principles do not discuss how the code works. An example of a principle is "no row events shall be written to the binlog if binlog_format=statement".ui

rulespa

Defines how to implement the principles. Rules can be formulated on a very high level, but they describe implementation (how the code works from the inside) rather than interface (how the program behaves when looking from the outside). An example of a rule is "at ROLLBACK when the transaction cache only contains updates to transactional tables, clear the transaction cache and do not write to the binlog".日志

In the next section, we list the source code files used by replication and describe what each file contains. The section after describes the replication principles and the following section describes the replication rules. The last section contains very old, obsolete documentation. It will be removed after we have verified that anything useful has been transferred to the main sections.code


咱们区分两个层次结构之间: 原理  和 规则orm

原理接口

从外部来看,做为高层次的标准声明该程序应是如何工做的。原则不讨论该代码是如何工做的。例如某原理的定义是“若是binlog_format =statement,行格式就不该该被写入二进制日志(注意这里的row event指的是binlog_format=row的状况下,binlog里面的event,这个event是binlog二进制里面定义的)”。事务

规则ip

定义如何实施的原理。规则能够在一个很是高的水平上制定,但它们描述的如何实现(从代码上看内如何工做的),而不是接口(程序从外面看时如何运行)。规则的一个例子是“当ROLLBACK时,事务缓存包含更新事务表内容,会被清除事务缓存而且不写入二进制日志”。

在下一节中,咱们列出了复制使用的源代码文件,并说明每一个文件内容。节后介绍复制原理及如下部分介绍复制规则。最后一节包含了很老的,过期的文档。通过咱们验证了什么有用的东西已经转移到主要部分将被删除。

相关文章
相关标签/搜索