Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ZooKeeper and RabbitMQ/Qpid together - overkill or a good combination?

Greetings,

I'm evaluating some components for a multi-data center distributed system. We're going to be using message queues (via either RabbitMQ or Qpid) so agents can make asynchronous requests to other agents without worrying about addressing, routing, load balancing or retransmission.

In many cases, the agents will be interacting with components that were not designed for highly concurrent access, so locking and cross-agent coordination will be needed to avoid race conditions. Also, we'd like the system to automatically respond to agent or data center failures.

With the above use cases in mind, ZooKeeper seemed like it might be a good fit. But I'm wondering if trying to use both ZK and message queuing is overkill. It seems like what Zookeeper does could be accomplished by my own cluster manager using AMQP messaging, but that would be hard to get really right. On the other hand, I've seen some examples where ZooKeeper was used to implement message queuing, but I think RabbitMQ/Qpid are a more natural fit for that.

Has anyone out there used a combination like this?

Thanks in advance,

-Chris

like image 720
Chris Sears Avatar asked Apr 19 '10 17:04

Chris Sears


People also ask

Does RabbitMQ need ZooKeeper?

RabbitMQ doesn't need an outside process running. Kafka requires Zookeeper's running instance for its broker management. Zookeeper is responsible for assigning a broker for the topic. Out of the box, RabbitMQ is behind in multithreading support compared to Kafka—but not by much.

Are zookeepers lightweight?

I'm happy to announce the availability of zookeepercli: a lightweight, simple, fast and controlled command line client for ZooKeeper. zookeepercli allows for: Basic CRUD-like operations: create , set , delete , exists , get , ls (aka children ).


1 Answers

Coming into this late, but maybe it will be of some use. The primary consideration should be the performance characteristics of your system. ZooKeeper, like you said, is more than capable of implementing a task distribution system using a distributed queue, but zk currently, is more optimized for reads than it is for writes (this only comes into play in the 1000's of ops per second range). If your throughput needs are less than this, then using just zk to implement your system would reduce number of runtime components and make it simpler. Of course, you should always run your performance tests before deciding.

Distributed coordination is really hard to get right, so I would definitely recommend using zookeeper for that and not rolling your own.

like image 141
manku Avatar answered Sep 16 '22 20:09

manku