etcd与zookeeper对比

从github中了解到ectd能做什么,以及etcd在分布式系统中的关键作用。

主要参考:

https://github.com/etcd-io/etcd/blob/master/Documentation/learning/why.md

从上面的文章中我总结出的关键内容如下:

zookeeper和etcd的区别,优缺点,为什么?

ZooKeeper solves the same problem as etcd: distributed system coordination and metadata storage. However, etcd has the luxury of hindsight taken from engineering and operational experience with ZooKeeper’s design and implementation. The lessons learned from Zookeeper certainly informed etcd’s design, helping it support large scale systems like Kubernetes. The improvements etcd made over Zookeeper include:
Dynamic cluster membership reconfiguration
Stable read/write under high load
A multi-version concurrency control data model
Reliable key monitoring which never silently drop events
Lease primitives decoupling connections from sessions
APIs for safe distributed shared locks
Furthermore, etcd supports a wide range of languages and frameworks out of the box. Whereas Zookeeper has its own custom Jute RPC protocol, which is totally unique to Zookeeper and limits its supported language bindings, etcd’s client protocol is built from gRPC, a popular RPC framework with language bindings for go, C++, Java, and more. Likewise, gRPC can be serialized into JSON over HTTP, so even general command line utilities like curl can talk to it. Since systems can select from a variety of choices, they are built on etcd with native tooling rather than around etcd with a single fixed set of technologies.
When considering features, support, and stability, new applications planning to use Zookeeper for a consistent key value store would do well to choose etcd instead.

简单的翻译过来就是说:

zookeeper和etc同样是为了解决分布式系统协调和元数据存储问题的。然而,etcd从工程和实现经验上比zookeeper更有前瞻性。etcd从zookeeper中吸取经验,从而支持大规模可扩展的kubernetes。etcd相比zookeeper主要有以下的改善:

  • 动态集群成员重配置
  • 高负载下的稳定读写能力
  • 数据的多版本控制
  • 可靠的事件监控,不会悄悄的丢失事件
  • 租赁原语将连接与会话分离
  • 安全的分布式锁

而且,etcd对外部的语言支持性更好。相反,zookeeper使用的是自定义的Jute RPC协议,这样限制了外部语言的绑定。etcd使用的是gRPC协议,能够支持现有的主流语言,比如:go C++ java等等。而且,gRPC可以序列化成Json,通过http传输,所以Curl等命令行的命令也可以访问。因为系统的选型是多样的,它们是使用本地工具在etcd上构建的,而不是使用一组固定的技术围绕etcd构建的。

考虑到以上的特性、支持和稳定性,计划使用zookeeper的新应用使用etcd代替zookeeper也是一个明智的选择。

 

最后总结一下就是说,能够使用zookeer的场景下,使用etcd是可以直接代替的,同时etcd还提供的更稳定的高负载稳定读写能力。 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值