Zookeeper v/s hardware loadbalancer
I've b开发者_运维技巧een looking at Zookeeper recently and wondered how it compares with a hardware loadbalancer for the following usecases:
- Service discovery
- Using ZooKeeper, the server would register itself on a common znode which can be looked up by the client to get a list of registered servers.
- Using H/W loadbalancer, I can have couple of server IPs behind a VIP name and the client is only aware of the VIP address.
- Load balancing
- Using ZooKeeper, the load-balancing happens at the client side.
- Using H/W LB, the load-balancing happens at the load-balancer side!
So for the above 2 usescase, are there any specific advantages in using ZooKeeper over a H/W load-balancer?
One ZooKeeper advantage is that it's more versatile. Server nodes can register more data than simply 'Hi, I'm alive'. You can use it for data sharding for example.
One HW load balancer advantage is that it can cache traffic (when used in front of typical HTTP server). For some workloads even a little bit of cache in RAM can dramatically lower the traffic that reaches your servers.
精彩评论