zookeeper 与 spring 云配置服务器有什么区别? [英] What's the difference between zookeeper vs spring cloud config server?

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

问题描述

zookeeper 和 spring 云配置服务器有什么区别?它们都将配置存储在服务器中并使它们可供客户端使用.

什么时候应该使用一个而不是另一个?

解决方案

zookeeper 和 spring 云配置服务器有什么区别?

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

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

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

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

从本质上讲,Zookeeper 提供了用于存储信息的分层命名空间.客户可以在此层次结构中插入新节点、更改它们或查询它们.此外,他们可以向节点添加监视以在它们发生变化时被告知.

<块引用>

什么时候应该使用一个而不是另一个?

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

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 云配置服务器有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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