I am going to implement the orchestration of a set of microservices in my application. Two widely using tools I found Apache Zookeeper and Netflix Eureka.
Can anyone please give a comparison based on fundamental differences, those two services have?
Is there any other powerful tool?
ZooKeeper is a centralized service for maintaining configuration information, naming, providing distributed synchronization, and providing group services. All of these kinds of services are used in some form or another by distributed applications.
Because Eureka is built explicitly for service discovery, it provides a client library that provides functionality such as service heartbeats, service health checks, automatic publishing, and refreshing caches. With ZooKeeper, you would have to implement all of these things yourself.
Eureka Server is an application that holds the information about all client-service applications. Every Micro service will register into the Eureka server and Eureka server knows all the client applications running on each port and IP address. Eureka Server is also known as Discovery Server.
Check out Curator Discovery (part of Apache Curator), a Zookeeper-based service registry written in Java. In SOA/distributed systems, services need to find each other. i.e. a web service might need to find a caching service, etc.
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:
Regarding comparing zookeeper, eureka and kubernetes:
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
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With