Redis queue vs MSMQ

FelProNet picture FelProNet · Oct 23, 2013 · Viewed 7.1k times · Source

For a long time we were using msmq and redis queue (IRedisList). Couple of month ago we started trying redis pub-sub .

Our application has more than twenty services that read messages from queue or subscribe to channels with redis . We also have more than ten queues that we send messages to them. The application is multi-threaded.

So what do i want from you?

Now we have some time to spend on deciding what kind of the queues above do we want to use and what do we want to replace with a different kind of queue.

I tried to look for post about MSMQ VS Redis and did not find enough information.

Can someone advise me about this issue?

Answer

Didier Spezia picture Didier Spezia · Oct 23, 2013

IMO, you are trying to compare apples and oranges here.

MSMQ is an enterprise-class MOM (message oriented middleware, i.e. a queuing system) offering persistency, transactional support, and a rich set of features.

Redis is a fast in-memory data structure server, on which you can build a queuing system. A proper implementation of the basic features of MSMQ with Redis is already a difficult task. It would probably not be possible at all to implement the advanced features (like the distribution transaction support).

I would suggest to try to list the properties you expect from the queuing system:

  • Do you need persistency?
  • Do you need transaction support?
  • Do you need distributed transaction support?
  • Do you need "once and only once" delivery semantic? At most once? At least once?
  • Do you need multiple retry policies (linear delay, exponential backoff, etc ...)?
  • Do you need exception/dead queues?
  • Do you need item retention?
  • Do you need queue browsing support? Queue administration capabilities?
  • Do you need item priority management?
  • Do you need automatic item expiration?
  • Do you need delayed items?
  • Do you need item sequencing? Last value queues?
  • Do you need publish-and-subscribe? With multi-casting?
  • Do you need to dequeue from several queues at the same time in a single thread?
  • Do you need high-availability and/or clustering support?
  • Do you have a high-throughput? Do you need the best performance?

Depending on your requirements Redis may or may not be a good fit. But do not expect to get the bells and whistles of a real MOM with Redis.

Last point: you mentioned the Redis pub/sub feature. Please note this mechanism is not at all based on a queuing system. There is no guarantee about the delivery of messages with Redis pub/sub. If a subscriber does not listen, the item will be lost for this subscriber.