redis supports pub-sub
zmq also supports pub-sub via a message broker
What would be the architectural pros\cons for choosing between them?
I'm aiming at points which are beyond the obvious use-case specific performance benchmarking that should be done (here's a nice example).
Assume use of a high-level language such as Python.
Its not pub sub, its more reliable since your consumer can be offline and the messages will queue up instead of being lost.
Redis Pub/Sub is designed for speed (low latency), but only with low numbers of subscribers. Subscribers don't poll and while subscribed/connected are able to receive push notifications very quickly from the Redis broker — in the low milliseconds, even less than 1 millisecond as confirmed by this benchmark.
No - Redis' Pub/Sub has no persistence, and once a message has been published, it is sent only to the connected subscribed clients.
I have worked with both ZeroMQ and Redis with python. I would say ZeroMQ is more robust, it offers real simple load balancing and also more than pub-sub, like request reply among others. But if you are only after pub-sub, redis is much simpler.
In case the redis server crashes or stops working, all the clients will stop working as well, with ZeroMQ, the clients work even if there is no server.
Both services are available with any programming language, ruby, python, C, C++ and more.
In short, redis is much simpler, very reliable. ZeroMQ is extremely reliable but more complex.
If I was only doing pub sub, I would pick redis, else I would pick ZeroMQ. If I would forsee huge loads of traffic, I would pick ZeroMQ
ZeroMq Pros/Cons
NEWS
subscription matches NEWS*
messages Redis Pros/Cons
news.*
supportedIf you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With