paxos(chubby) vs zab(Zookeeper)
参考:
Paxos vs. Viewstamped Replication vs. Zab
Zab: High-performance broadcast for primary-backup systems
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)的更多相关文章
- Zookeeper协议篇-Paxos算法与ZAB协议
前言 可以自行去学习一下Zookeeper中的系统模型,节点特性,权限认证以及事件通知Watcher机制相关知识,本篇主要学习Zookeeper一致性算法和满足分布式协调的Zab协议 Paxos算法 ...
- 从Paxos到ZooKeeper-二、ZooKeeper和Paxos
ZooKeeper为分布式应用提供了高效且可靠的分布式协调服务,提供了诸如tong'yi统一命名服务.配置管理和分布式锁等分布式的基础服务.在解决分布式数据一致性方面,ZooKeeper并没有直接采用 ...
- 分布式技术专题-分布式协议算法-带你彻底认识Paxos算法、Zab协议和Raft协议的原理和本质
内容简介指南 Paxo算法指南 Zab算法指南 Raft算法指南 Paxo算法指南 Paxos算法的背景 [Paxos算法]是莱斯利·兰伯特(Leslie Lamport)1990年提出的一种基于消息 ...
- 从Paxos到ZooKeeper-三、ZooKeeper的典型应用场景
ZooKeeper是一个典型的发布/订阅模式的分布式数据管理与协调框架,开发人员可以使用它来进行分布式数据的发布与订阅.另一方面,通过对ZooKeeper中丰富的数据节点类型进行交叉使用,配合Watc ...
- 从Paxos到ZooKeeper-四、ZooKeeper技术内幕
本文将从系统模型.序列化与协议.客户端工作原理.会话.服务端工作原理以及数据存储等方面来揭示ZooKeeper的技术内幕. 一.系统模型 1.1 数据模型 ZooKeeper的视图结构使用了其特有的& ...
- Leader Election 选举算法
今天讲一讲分布式系统中必不可少的选举算法. leader 就是一堆服务器中的协调者,某一个时刻只能有一个leader且所有服务器都承认这个leader. leader election就是在一组进程中 ...
- 【分布式】Zookeeper与Paxos
一.前言 在学习了Paxos在Chubby中的应用后,接下来学习Paxos在开源软件Zookeeper中的应用. 二.Zookeeper Zookeeper是一个开源的分布式协调服务,其设计目标是将那 ...
- Zookeeper和 Google Chubby对比分析
详见:http://blog.yemou.net/article/query/info/tytfjhfascvhzxcyt375 随着云计算的推广,云平台的设计和实现越来越复杂,很多系统属性如一致性和 ...
- ZAB协议和Paxos算法
前言在上一篇文章Paxos算法浅析中主要介绍了Paxos一致性算法应用的场景,以及对协议本身的介绍:Google Chubby是一个分布式锁服务,其底层一致性实现就是以Paxos算法为基础的:但这篇文 ...
随机推荐
- JavaScript OOP 之「创建对象」
工厂模式 工厂模式是软件工程领域一种广为人知的设计模式,这种模式抽象了创建具体对象的过程.工厂模式虽然解决了创建多个相似对象的问题,但却没有解决对象识别的问题. function createPers ...
- .NET跨平台之旅:corehost 是如何加载 coreclr 的
在前一篇博文中,在好奇心的驱使下,探秘了 dotnet run ,发现了神秘的 corehost —— 运行 .NET Core 应用程序的幕后英雄.有时神秘就是一种诱惑,神秘的 corehost ...
- JavaEE学习文章汇总-并发,集群,分布式
以下文章来自博客 http://blog.csdn.net/FX_SKY/article/category/6203839 其中包括 集群Zookeeper 环境搭建 http://blog.csdn ...
- [教程]phpwind9.0应用开发基础教程
这篇文章着重于介绍在9.0中如何开发一个插件应用的示例,step by step来了解下在9.0中一个基础的应用包是如何开发的.1.目录结构OK,首先是目录结构,下面是一个应用我们推荐的目录. 应用包 ...
- $.post 跨域传输数据
使用的是TP框架 前端代码: <!DOCTYPE html><html> <head> <title>这里是前端代码</title> < ...
- ASP.NET MVC 应用,站点发布到本地IIS
材料准备 visual studio 2013 , iis 7 具体步骤 1.以管理员身份启动visual studio 2.新建项目 web app 或者站点 3.编译项目 4.右击项目选择publ ...
- grails 优缺点分析
Grails是一套用于快速Web应用开发的开源框架,它基于Groovy编程语言,并构建于Spring.Hibernate等开源框架之上,是一个高生产力一站式框架. 易于使用的基于Hibernate的对 ...
- BZOJ 2007: [Noi2010]海拔
2007: [Noi2010]海拔 Time Limit: 20 Sec Memory Limit: 552 MBSubmit: 2410 Solved: 1142[Submit][Status] ...
- django文件上传和序列化
django实现文件上传 使用form表单上传文件 html页面 <html lang="en"> <head> <meta charset=&quo ...
- 关于SQL的相关笔记【长期更新,只发一帖】
场景[1]多表联查时,主表与关联表同时与同一张(第三张表)有关联,类似三角恋关系- - 涉及表: HOUSE:记录了房屋信息 ROOMS:记录了房间信息 HOUSE_STATUS:记录了状态信息的中文 ...