Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redis queue vs MSMQ

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?

like image 541
FelProNet Avatar asked Oct 23 '13 09:10

FelProNet


People also ask

Is Redis good for message queue?

Redis Pub/Sub is an extremely lightweight messaging protocol designed for broadcasting live notifications within a system. It's ideal for propagating short-lived messages when low latency and huge throughput are critical. Redis Lists and Redis Sorted Sets are the basis for implementing message queues.

Can you use Redis as a queue?

Using Redis with Redis Queue allows you to enter those complex tasks into a queue, so the Redis worker executes these tasks outside of your application's HTTP server. In this article, we will build an app that enqueues jobs with Redis queue, performs a function on those jobs and returns the result of the function.

Can I use Redis as a message broker?

At its core, Redis is an in-memory data store that can be used as either a high-performance key-value store or as a message broker.

Is there any relation between Redis and queues?

One feature of Redis is that a task cannot leave the control of Redis until it has completed. So in this case, Redis transfers the task into another Queue, let's call it the 'work' or 'processing' queue. Each task will be deferred to this work queue before being given to the application.


1 Answers

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.

like image 78
Didier Spezia Avatar answered Oct 02 '22 05:10

Didier Spezia