参考:

Zookeeper的一致性协议:Zab

Chubby&Zookeeper原理及在分布式环境中的应用

Paxos vs. Viewstamped Replication vs. Zab

Zab vs. Paxos

Zab: High-performance broadcast for primary-backup systems

Chubby:面向松散耦合的分布式系统的锁服务

Chubby 和Zookeeper 的理解

zookeeper 使用Zab(zookeeper atom broadcast).

Zab集群机器越多,写性能会有所降低、读性能得到水平扩展。从Follower直接读取数据,随不保证最新,但最终会读到最新的,但在其应用领域配置、分布式事务等业务上看已经是强一致性了。

为啥用Zab 而不是paxos?

从Zookeeper 提供API看,写操作需要先获取Txid,写冲突由业务层重新获取Txid重试,也就是说每个操作都包含隐形事务性,有事务让zookeeper有更多的应用场景。这也就要求同步协议保证因果顺序性。paxos是无法保证多个写之间因果顺序,要实现的话只能串行执行,效率低而不可行。

当然也可基于paxos,通过多个操作,从业务层面上实现zookeeper事务功能,但zab 这么设计要高效很多。

具体下面描述更加清楚:

Zab is a different protocol than Paxos, although it shares with it some key aspects, as for example:

  • A leader proposes values to the followers
  • Leaders wait for acknowledgements from a quorum of followers before considering a proposal committed (learned)
  • Proposals include epoch numbers, which are similar to ballot numbers in Paxos

The main conceptual difference between Zab and Paxos is that it is primarily designed for primary-backup systems, like Zookeeper, rather than for state machine replication.

Paxos can be used for primary-backup replication by letting the primary be the leader. The problem with Paxos is that, if a primary concurrentlyproposes multiple state updates and fails, the new primary may apply uncommitted updates in an incorrect order. An example is presented in our DSN 2011 paper(Figure 1). In the example, a replica should only apply the state update B after applying A. The example shows that, using Paxos, a new primary and its follows may apply B after C, reaching an incorrect state that has not been reached by any of the previous primaries.

A workaround to this problem using Paxos is to sequentially agree on state updates: a primary proposes a state update only after it commits all previous state updates. Since there is at most one uncommitted update at a time, a new primary cannot incorrectly reorder updates. This approach, however, results in poor performance.

Zab does not need this workaround. Zab replicas can concurrently agree on the order of multiple state updates without harming correctness. This is achieved by adding one more synchronization phase during recovery compared to Paxos, and by using a different numbering of instances based on zxids.

Chubby VS Zookeeper:

zookeeper 比chubby提供更强数据一致性性(因果顺序),写性能会差一些。

paxos(chubby) vs zab(Zookeeper)的更多相关文章

  1. Zookeeper协议篇-Paxos算法与ZAB协议

    前言 可以自行去学习一下Zookeeper中的系统模型,节点特性,权限认证以及事件通知Watcher机制相关知识,本篇主要学习Zookeeper一致性算法和满足分布式协调的Zab协议 Paxos算法 ...

  2. 从Paxos到ZooKeeper-二、ZooKeeper和Paxos

    ZooKeeper为分布式应用提供了高效且可靠的分布式协调服务,提供了诸如tong'yi统一命名服务.配置管理和分布式锁等分布式的基础服务.在解决分布式数据一致性方面,ZooKeeper并没有直接采用 ...

  3. 分布式技术专题-分布式协议算法-带你彻底认识Paxos算法、Zab协议和Raft协议的原理和本质

    内容简介指南 Paxo算法指南 Zab算法指南 Raft算法指南 Paxo算法指南 Paxos算法的背景 [Paxos算法]是莱斯利·兰伯特(Leslie Lamport)1990年提出的一种基于消息 ...

  4. 从Paxos到ZooKeeper-三、ZooKeeper的典型应用场景

    ZooKeeper是一个典型的发布/订阅模式的分布式数据管理与协调框架,开发人员可以使用它来进行分布式数据的发布与订阅.另一方面,通过对ZooKeeper中丰富的数据节点类型进行交叉使用,配合Watc ...

  5. 从Paxos到ZooKeeper-四、ZooKeeper技术内幕

    本文将从系统模型.序列化与协议.客户端工作原理.会话.服务端工作原理以及数据存储等方面来揭示ZooKeeper的技术内幕. 一.系统模型 1.1 数据模型 ZooKeeper的视图结构使用了其特有的& ...

  6. Leader Election 选举算法

    今天讲一讲分布式系统中必不可少的选举算法. leader 就是一堆服务器中的协调者,某一个时刻只能有一个leader且所有服务器都承认这个leader. leader election就是在一组进程中 ...

  7. 【分布式】Zookeeper与Paxos

    一.前言 在学习了Paxos在Chubby中的应用后,接下来学习Paxos在开源软件Zookeeper中的应用. 二.Zookeeper Zookeeper是一个开源的分布式协调服务,其设计目标是将那 ...

  8. Zookeeper和 Google Chubby对比分析

    详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcyt375 随着云计算的推广,云平台的设计和实现越来越复杂,很多系统属性如一致性和 ...

  9. ZAB协议和Paxos算法

    前言在上一篇文章Paxos算法浅析中主要介绍了Paxos一致性算法应用的场景,以及对协议本身的介绍:Google Chubby是一个分布式锁服务,其底层一致性实现就是以Paxos算法为基础的:但这篇文 ...

随机推荐

  1. haproxy windows环境使用

    haproxy下载:http://pan.baidu.com/s/1miEvQUc 测试环境说明: ip地址 作用 开放端口 备注 nbproc 1 daemon defaults mode tcp ...

  2. jQuery 事件方法

    事件方法触发器或添加一个函数到被选元素的事件处理程序. 下面的表格列出了所有用于处理事件的 jQuery 方法. 方法 描述 bind() 向匹配元素附加一个或更多事件处理器 blur() 触发.或将 ...

  3. JS倒计时执行操作

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  4. Tomcat内存溢出的三种情况及解决办法分析

    Tomcat内存溢出的原因 在生产环境中tomcat内存设置不好很容易出现内存溢出.造成内存溢出是不一样的,当然处理方式也不一样. 这里根据平时遇到的情况和相关资料进行一个总结.常见的一般会有下面三种 ...

  5. 问题记录:JavaFx 鼠标滑轮滚动事件监听!

    问题描述: 在listview的item里面添加鼠标拖拽排序功能.代码如下: setOnMouseDragged(event -> { //设定鼠标长按0.3秒后才可拖拽 防止误操作 isCan ...

  6. Table 表单

    <style> table th { white-space: nowrap; } .chk { white-space: nowrap; } </style> <tab ...

  7. Angularjs兼容IE

    http://www.tuicool.com/articles/EJv6riY http://www.angularjs.cn/A00v http://www.cnblogs.com/ahl5esof ...

  8. WebService的使用

    转载至http://blog.csdn.net/yexuanbaby/article/details/9029605/ 第一次选择WebService,是为了替代数据库远程连接.我们都知道当SQL允许 ...

  9. 聊一聊PV和并发

    最近和几个朋友,聊到并发和服务器的压力问题.很多朋友,不知道该怎么去计算并发?部署多少台服务器才合适? 所以,今天就来聊一聊PV和并发,还有计算web服务器的数量 的等方法.这些都是自己的想法加上一些 ...

  10. Oracle数据库找回密码

    Oracle数据库忘记用户的密码.经验证,可行的解决方案如下: 1.Ctrl + R 打开cmd窗口,输入 sqlplus / as sysdba  (注意/左右两侧有空格) 2.运行cmd ,输入 ...