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:
- A user sends a message to a friend.
- The server receives the request (probably a HTTP POST).
- 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.
- 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.