参考:

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. Zabbix2.4.7源码安装手册

    一.安装Apache Server 注:使用root安装后,变更拥有者为your-user 1 安装环境 系统: CentOS release 6.6 软件: httpd-2.2.31 2 安装步骤 ...

  2. 关于SQL注入和如何防止

    之前在笔试的时候没有很好的答出这个问题,因此我要总结一下问题,以免日后继续在这个地方跌倒,以下是自己的理解,如有错误请指出 一.什么是SQL注入 SQL注入就是服务器在根据业务去处理数据库的时候,客户 ...

  3. Quartz定时任务

    spring多个定时任务quartz配置 例子1: biz-quartz-context.xml配置 <?xml version="1.0" encoding="U ...

  4. Deconvolution Using Theano

    Transposed Convolution, 也叫Fractional Strided Convolution, 或者流行的(错误)称谓: 反卷积, Deconvolution. 定义请参考tuto ...

  5. PHP函数

    2017.1.5 stream_get_contents函数:读取数据流中的剩余数据到字符串 [功能说明] 该函数同file_get_COntents()函数的作用相同,只不过该函数用于读取已经打开的 ...

  6. 获取iis网站信息

    1.获取网站的url地址 var ht = GetWebPathAndWebName(""); var rootUrl = ht["webaddr"].ToSt ...

  7. Javascript中两个等于号和三个等于号的区别(==/===)

    ==//表示值的比较 ===//表示对象类型的比较 1.对于string,number等基础类型,==和===是有区别的. a)不同类型间比较,==之比较“转化成同一类型后的值”看“值”是否相等,== ...

  8. JavaScript replace() 方法

    参考:http://www.w3school.com.cn/jsref/jsref_replace.asp 需要有一点注意的是:可以是函数的形式做为返回值,如下: "test{0}" ...

  9. Unity Animator动画状态机 深入理解(一)

    接触Unity以来就已经有了Animator,Animation用的少,不过也大概理解他俩之间的一个区别于联系. 图中其实就是Animator和Animation之间的区别于联系了,啊!你肯定会告诉我 ...

  10. mysql 错误 ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number 解决办法

    MySQL创建用户(包括密码)时,会提示ERROR 1372 (HY000): Password hash should be a 41-digit hexadecimal number: 问题原因: ...