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時,事務緩存包含更新事務表內容,會被清除事務緩存而且不寫入二進制日誌」。

在下一節中,咱們列出了複製使用的源代碼文件,並說明每一個文件內容。節後介紹複製原理及如下部分介紹複製規則。最後一節包含了很老的,過期的文檔。通過咱們驗證了什麼有用的東西已經轉移到主要部分將被刪除。

相關文章
相關標籤/搜索