ZooKeeper is commonly used but not always the best solution. There are three key areas to evaluate when determining if ZooKeeper is appropriate: where it is running, what it is doing, and what primitives are being used. Alternatives like load balancers, DNS, or databases may be better depending on the use case and operational needs.
The Hadoop EcosystemMany OS distributed systemsSolr, Kafka, StormRedisHA
Internally at most companies with large tech deploymentsFoursquare, Facebook, NetflixBanks of all stripes
In the guts of many cloud computing effortsNicira (Virtual Networking)Boundary (Network Monitoring)
$$$ Simpler systems, low operational complexity No dependencies on third party software Don’t need every feature Better to embed a consensus system as a library that can be tuned to the needs of the software than run an external cluster for consensus Lack of consensus system availability may mean system should stop functioning, need to have higher availability than 2F+1
More on this later
Discovery, Registry, Configuration, Monitoring
Simple load balancer that removes IPs when they are not available Great for the case when services are always in the same version Great for the case of connection-per-request Not great for load balancing of long-lived connectionsDNS Can also be used for minor config information TTL means that it has a fairly static view of the world Requires a deployment into the DNS server to update for new hardwareDatabase table Additional load on db resource No auto-detection of servers that die
Atomicity Sequential Consistency ReliabilityEPHEMERAL NODES Session-awareWATCHES No polling!
Writing correct code is hard and bad code can bring down your clusterA story…ZooKeeper has bugs, yes, particularly in new and rarely-used featuresBut most problems people face are due to their own misunderstanding or misuse of the clusterHow do you manage this?Don’t run ZK as a service for many different appsCode Review by a central group all ZK codeProvide a specialized client that wraps ZK functionality into larger chunks for specialized uses