11.07
I saw Shoemoney’s blog about Jimdo. And remembered that I had implemented Jimdo’s Dropr PHP message queue system.
I had searched a while back for a PHP message queue. A message queue allows you to send a message over a distributed network, and pull the messages for later processing. So you can defer time-consuming tasks and have them reliably completed later.
A message queue is a common enterprise pattern, that is well supported in languages like Java. However, in PHP, I didn’t find a clear leader:
- Zend Framework has one (albeit not real fast)
- ActiveMQ – complex
- all sorts of PHP -> JMS bridges
- beanstalkd – highly performant (but its all in memory, so not fault-tolerant)
- Dropr – super easy to use, and decently fast
Jimdo had a need for a distributed message queue. So they created Dropr, and open sourced it to the world! They use a local file + TCP based transport model. Which is kind of similar to how Email / SMTP transports. Its a simple model to digest and actually works really well.
Out of the box Dropr advertizes performance of 150 messages per second. But after some profiling and optimization. (Think xdebug + kcachegrind.) I was able to reach local transport performance of 3000 messages per second.
With Dropr + Memcached – I was able to achieve an interesting reality — a website that operates fully functional, both Read + Write, while the Database is down! When the database returns, the messages fill in automatically! Definitely check out Dropr for your distributed messaging needs.
And a big thanks to Jimdo for giving back to the community!!
[...] post: Jimdo + Dropr PHP Message Queue Related ArticlesBookmarksTags PHP PHP is a computer scripting language. Originally [...]
Hi Jay,
thanks for promoting dropr
Nice and interesting catch about dropr+memcached.
And really cool to know that other people also have a use for our small tool.
We’ll keep working on that topics.
-soenke
Message Queuing for PHP, really?!
This is a really excellent idea. Could you show us some of your code, so we can see how you achieved the link between dropr & memcached?