What is the role of Zookeeper vs Eureka for microservices?

Another tool might be Consul.

Eureka is mostly a service discovery tool and mostly designed to use inside AWS infrastructure.

Zookeeper is a common-purpose distributed key/value store which can be used for service-discovery in conjunction with curator-x-discovery framework

Here is a brief overview of service-discovery solutions

You can also find comparison of Consul vs Eureka vs Zookeeper here.

Although Consul is as well as zookeeper - can be used not only for discovery but as a key/value store, the advantages of Consul are cool service discovery features out of the box

  1. DNS out of the box
  2. convenient RESTful API
  3. HealthCheck API out of the box

Also consul has more distributed nature: agents are installed on all service VMs and hence the system has higher availability than zookeeper. Be aware that consul system has low coupling between datacenters.

Zookeeper is mature, but too generic. So you can use zookeeper not only for service discovery but for storing configs, distributed locks, notifications etc. Again, it's convenient to use all this functionality with Curator Framework / Curator Recipes.

Zookeeper is using master/slave communication schema between nodes in cluster. Master is elected by cluster members. Be aware that there could be edge cases (due to network issues for example) when it appears more that 1 master in the cluster. In this case restart of the cluster helps.

Difference of Eureka from Zookeeper and Consul is that Eureka is narrow-purpose system - service discovery and load balancing system.

All 3 systems can be integrated with Spring.


I am going to implement the orchestration of a set of microservices in my application.

This is a hard problem to solve by yourself. You are probably better off using an existing orchestration system (see below).

Is there any other powerful tool?

You should look into kubernetes, which seems to be the standard in orchestration these days. It has many additional benefits (enable scalability, self-healing, etc) and is widely used in production today. See the following links:

  • Kubernetes webpage
  • Article

Regarding comparing zookeeper, eureka and kubernetes:

  • Zookeeper is a distributed key value store. It can be used as the basis to implement service discovery (similar to etcd).
  • Eureka is primarily a service locator used as part of Netflixes load balancers and failover(allow finding the right service targets for distributing client calls to members of an application cluster).
  • Kubernetes is a container orchestration solution that includes the deployment, discovery and self-healing of services. For a complete list of features, check the link above. The service discovery in kubernetes is based on dns in the virtual network it spans and builds upon etcd.
  • Consul (mentioned in the other answer) is a service discovery framework with a REST interface and some additional features (Health Checking, Service Segmentation,..). It has its own internal distributed key value store that can be used as well.