Does it make sense to implement a message queue system such as RabbitMQ or Kafka for the purpose of storing data in a queue? For example, this could be done in order to handle things such as notifications and instant messaging between users, while still storing message information in an actual database such as Cassandra like so:

  1. A user sends a message to a friend.
  2. The server receives the request (probably a HTTP POST).
  3. The server processes the request by writing the message to the database, which will never be deleted, and additionally adding the reference to that message to a notifications queue representing new messages.
  4. The friend is subscribed to the notifications stream and receives new messages instantly.

This seems like a very useful application of message queues. However, I wanted to make sure that it made sense to use it instead of using only a database and server-based events (such as that of Node.js) for this particular purpose.

Edit: Note that there is, however, no backround process that is distinct from the main application. So implementing a message queue won't make much of a difference in terms of asynchronous optimization.

  • 2
    Kinda depends on your software's requirements specification. I can see valid use cases both ways. – Robert Harvey Nov 4 '14 at 19:44
  • Yep. Your question is essentially "Is it worth using a message queue system to store messages in a queue?" – Rocklan Nov 4 '14 at 23:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.