
Why need replication …
1.
可以提高效率,因為使用者可以存取最近的副本。
Improved performance since users can access nearest replicas.
2.
有利於擴大系統,因為單點效率提高。
Aided scaling since the performance improved at each node.
3.
系統可以處理節點的錯誤,因為有可替代的副本。
System can handle failures since there is replaceable replicas.
Why replication is hard …
1.
節點多,如果出錯的話,難以找到錯誤。
It is hard to find failure if there some things go down since it is too many nodes.
2.
最大的挑戰是:如何保證每個副本的一致性。
The biggest challenge is to make sure the consistency across replicas.

Roles …
Primary
1.
Primary 可以有多個 backup 溝通。
Primary can have several backups.
2.
直接跟客戶溝通的管道。
The entry that can communication with clients directly.
Backup
1.
每個 backup 只認定一個 primary。
Each backup has only one primary.
2.
必須向 primary 註冊自己。
Have to register itself to primary.

Process …
1.
客戶像 primary 發送訊息。
Client sends message to primar
2.
Primary 接收到後,跟 backup 同步。
After received the message, primary sync with backup.
3.
Primary 收到 backup ACK 的訊息,確認 backup 已經同步完成。
Primary received ACK from backup to ensure backup completion.
3.
同步完後,primary 回應 client。
After syncing, primary responds to client.
Questions …
1. If primary failed, how to handle it?
將其中一個 backup 變成 primary。
Promote one of backups as the primary.
2.If backup failed, how to handle it?
只要 primary 沒有失敗,就可以重啟一個 backup,不會影響到系統運作。
As soon as primary is successful, simply adds a new backup. The backup failure won’t affect system.
3. What’s the challenge of primary-backup replication?
如何找到適當的 primary-backup 比例。
How to find the right ratio between primary and backup.
-MsHe
有一則關於 淺談 Primary-Backup Replication 的留言