参考:

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. css的初始化样式

    一切为了敏捷开发: http://blog.sina.com.cn/s/blog_71ed1b870101a52w.html CSS初始化示例代码 /* css reset www.admin1000 ...

  2. jquery版滑块导航栏

    <!DOCTYPE html><html> <head> <meta charset="UTF-8"> <script src ...

  3. Python进制转换

    一 内置函数 bin().oct().hex()的返回值均为字符串,且分别带有0b.0o.0x前缀. 实例 统计二进制数里1的个数 def countBits(n): return bin(n).co ...

  4. supermpa配置遇到的问题

    环境 vs2010  supermap idesktop7.1.2  iobject7.1.2.net windowform 问题 在安装iobject7.1.2 64位时 在vs中的工具箱是不显示s ...

  5. linux下mnt目录作用

    linux下mnt目录作用 一.mount 英文解释 登上; 爬上; 攀登; 骑上; 乘上; 跨上 可直接理解为“挂载” 挂接光驱.USB设备的目录,加载后,会在mnt里多出相应设备的目录.mnt是m ...

  6. redis消息队列简单应用

    消息队列出现的原因 随着互联网的高速发展,门户网站.视频直播.电商领域等web应用中,高并发.大数据已经成为基本的标识.淘宝双11.京东618.各种抢购.秒杀活动.以及12306的春运抢票等,他们这些 ...

  7. vs2015 生成项目时,提示执行失败,参数错误

    今天vs2015 生成项目时,提示执行失败,参数错误.查了很多资料未解决 后来,发现只有一个项目出现这个问题,其他项目生成正常.怀疑是该项目解决方案的问题 于是将解决项目中的项目移除,逐一生成引用,解 ...

  8. 在 .NET 中开发基于 Chrome 内核的浏览器-创建一个简单浏览器

    首先在 http://www.cftea.com/tools/downloads/Cef.zip 下载文件包. 一.将文件解压拖入到 Visual Studio 对应的 WinForm 项目中. 二. ...

  9. 第二章 --- 关于Javascript 设计模式 之 策略模式

    这一章节里面,我们会主要的针对JavaScript中的策略模式进行理解和学习 一.定义 策略模式: 定义一系列的算法,把他们封装起来,并且是他们可以相互替换. (这样的大的定义纲领,真的不好理解,特别 ...

  10. leetcode--Maximum Subarray

    题目链接:https://leetcode.com/problems/maximum-subarray/ 算法类型:动态规划 题目分析:最大序列和 代码实现: class Solution(objec ...