zookeeper和spring cloud config服务器之间有什么区别? [英] What's the difference between zookeeper vs spring cloud config server?

查看:577
本文介绍了zookeeper和spring cloud config服务器之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

zookeeper与spring cloud config服务器之间有什么区别?它们都将配置存储在服务器中并使它们对客户端可用.

何时应该使用另一个?

解决方案

zookeeper与spring cloud config server有什么区别?

使用Spring Cloud Config Server,您可以在中心位置管理所有环境中应用程序的外部属性.配置服务器上的概念与Spring EnvironmentPropertySource抽象具有相同的映射,因此它们非常适合Spring应用程序,但可以与以任何语言运行的任何应用程序配合使用.

Zookeeper不仅仅是一个分布式配置服务器,它还是一种集中式服务,几乎可以用于 一系列令人困惑的用例,包括配置管理,同步数据 服务,领导者选举,消息队列以及命名之间 服务.

如果您只想关注配置管理部分,我应该说,它们是同一概念的不同实现.

使用Spring Cloud Config Server,您有一个配置服务器(默认情况下)由git存储库支持.每当对该git储存库进行新的推送时,配置服务器就会知道新的配置值.配置服务器的客户端可以从服务器获取新的配置值并重新配置自己,也可以通过连接到云总线来采用事件驱动的方法.

Zookeeper的核心是提供用于存储信息的分层名称空间.客户群 可以在此层次结构中插入新节点,更改它们或查询它们.此外,他们可以 将手表添加到要更改的节点上.

何时应该使用另一个?

在我看来,Spring Cloud似乎非常适合许多云原生应用程序,尤其是如果您已经在使用spring框架.另外,基于存储库的配置服务器方法对我来说更自然,而且非常灵活,您可以轻松地存储通用,特定于应用程序和基于环境的配置值.最后但并非最不重要的一点是, Spring Cloud Zookeeper 可作为Spring Cloud的一部分使用./p>

What's the difference between zookeeper vs spring cloud config server? They both store configurations in server and make them available to clients.

When should one be used over the other?

解决方案

What's the difference between zookeeper vs spring cloud config server?

With the Spring Cloud Config Server you have a central place to manage external properties for applications across all environments. The concepts on config server map identically to the Spring Environment and PropertySource abstractions, so they fit very well with Spring applications, but can be used with any application running in any language.

Zookeeper is more than just a Distributed Configuration Server, it's a centralized service used for an almost bewildering array of use cases, including configuration management, synchronizing data between services, leader election, message queues, and as a naming service.

If you want to focus on just the configuration management part, i should say, they're different implementations of the same concept.

With Spring Cloud Config Server, you have a config server backed by a (by default) git repository. Every time a new push happens to that git repository, the config server would be aware of the new configuration values. Clients of the config server can either pull the new config values from the server and reconfigure themselves or pursue an event driven approach by connecting to a cloud bus.

At its heart, Zookeeper provides a hierarchical namespace for storing information. Clients can insert new nodes in this hierarchy, change them, or query them. Furthermore, they can add watches to nodes to be told when they change.

When should one be used over the other?

In my opinion, Spring Cloud seems a good fit for many cloud-native applications, especially if you're already using spring framework. Also, the repository based approach of config server feels more natural to me and is very flexible, you can easily store generic, application specific and environment based configuration values. And last but not least, Spring Cloud Zookeeper is available as part of spring cloud.

这篇关于zookeeper和spring cloud config服务器之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆