Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Message queuing solution for millions of topics

I'm thinking about system that will notify multiple consumers about events happening to a population of objects. Every subscriber should be able to subscribe to events happening to zero or more of the objects, multiple subscribers should be able to receive information about events happening to a single object.

I think that some message queuing system will be appropriate in this case but I'm not sure how to handle the fact that I'll have millions of the objects - using separate topic for every of the objects does not sound good [or is it just fine?].

Can you please suggest approach I should should take and maybe even some open source message queuing system that would be reasonable?

Few more details:

  • there will be thousands of subscribers [meaning not plenty of them],
  • subscribers will subscribe to tens or hundreds of objects each,
  • there will be ~5-20 million of the objects,
  • events themselves dont have to carry any message. just information that that object was changed is enough,
  • vast majority of objects will never be subscribed to,
  • events occur at the maximum rate of few hundreds per second,
  • ideally the server should run under linux, be able to integrate with the rest of the ecosystem via http long-poll [using node js? continuations under jetty?].

Thanks in advance for your feedback and sorry for somewhat vague question!

like image 292
pQd Avatar asked Aug 27 '12 18:08

pQd


People also ask

What problem does message queues solve?

Message queues help in decoupling components in an architecture. Using message queues improves fault tolerance, scalability, development time and freedom of language.

Does message queue decrease performance?

The Message Queue persistent store must be updated with the acknowledgment information for all persistent messages received by consumers, thereby decreasing performance.

How are messaging queues implemented?

Message queues implement an asynchronous communication pattern between two or more processes/threads whereby the sending and receiving party do not need to interact with the message queue at the same time. Messages placed onto the queue are stored until the recipient retrieves them.


1 Answers

I can highly recommend RabbitMQ. I have used it in a couple of projects before and from my experience, I think it is very reliable and offers a wide range of configuraions. Basically, RabbitMQ is an open-source ( Mozilla Public License (MPL) ) message broker that implements the Advanced Message Queuing Protocol (AMQP) standard.

As documented on the RabbitMQ web-site:

RabbitMQ can potentially run on any platform that Erlang supports, from embedded systems to multi-core clusters and cloud-based servers.

... meaning that an operating system like Linux is supported.

There is a library for node.js here: https://github.com/squaremo/rabbit.js

It comes with an HTTP based API for management and monitoring of the RabbitMQ server - including a command-line tool and a browser-based user-interface as well - see: http://www.rabbitmq.com/management.html.

In the projects I have been working with, I have communicated with RabbitMQ using C# and two different wrappers, EasyNetQ and Burrow.NET. Both are excellent wrappers for RabbitMQ but I ended up being most fan of Burrow.NET as it is easier and more obvious to work with ( doesn't do a lot of magic under the hood ) and provides good flexibility to inject loggers, serializers, etc.

I have never worked with the amount of amount of objects that you are going to work with - I have worked with thousands ( not millions ). However, no matter how many objects I have been playing around with, RabbitMQ has always worked really stable and has never been the source to errors in the system.

So to sum up - RabbitMQ is simple to use and setup, supports AMQP, can be managed via HTTP and what I like the most - it's rock solid.

like image 65
Lasse Christiansen Avatar answered Oct 20 '22 05:10

Lasse Christiansen