views:

1170

answers:

3

At work, we need to build a jobs server for things like sending emails, building PDFs, crunching some data, etc. Obviously, we'd like to build on some sort of generic queueing system. I'm familiar with Gearman, and that this is exact problem that it tries to solve: putting jobs on a queue where workers come to pick them up. However, I'm seeing lots of mentions of Rabbitmq and am unclear how it's used in this scenario.

Is Rabbitmq a good framework to build a distributed jobs system on top of?

+6  A: 

I would say that Gearman is better for queuing "jobs" and RabbitMQ is better for queuing "data". Of course, they are both really the same thing, but the way it works out for me is that if you are trying to "fan out" work to be done, and the workers can work independently, Gearman is the better way to do it. But if you are trying to feed data from a lot of sources down into fewer data consumers, RabbitMQ is the better solution.

The history of RabbitMQ, as something that allowed Twitter to take bursty loads of messages, and feed them into crusty old SMS gateways that could keep only one connection open, were rate limited, and didnt have retries, is illustrative of the kind of problems that RabbitMQ is good at solving.

Mark Atwood
+4  A: 

It all depends what semantics you want to expose. It's really easy to do what Gearman does on top of RabbitMQ, which can certainly 'fan out' messages to independent workers.

But Gearman is built for purpose. IIUC, Gearman is a framework for processing jobs and not a messaging system as such. There are other such frameworks such as Celery that use RabbitMQ under the hood for that. Here is an article about Celery that is worth reading.

Hope this helps!

alexis

alexis
Not only us Celery Python-only, but it actually has the entire Django framework as a dependency. In my experience, it feels as though the author wrote it specifically for his environment to fill his specific needs. Which isn't necessarily a bad thing, but it's not a fair comparison to either Gearman or RabbitMQ itself, both of which are very flexible.
jamieb
Holding a grudge? :) Celery is not Python-only, it can work over HTTP, which IMHO is a better model than what gearman uses for multiple language support (implement workers in the languages you want to support). It would be easy to implement celery workers in other languages as well, as celery is really a message protocol, where celeryd just happens to be the Python implementation of it. I don't know where you get the idea that it's not fair to compare Celery to Gearman, but you should read the FAQ - especially http://bit.ly/cSh6Ys + http://bit.ly/cANwUg - and supply us with some new arguments
asksol
+1  A: 

PS.

Re processing PDFs, Sean Cribbs' article is worth a read here.

alexis