In a typical design of a middle tier and a back end for a mobile app do you need messaging service such as ActiveMQ, Qpid or something of that sort?
-
Suppose you are devising an architecture for a mobile app that, for the sake of this discussion, does nothing else but exchanges short messaging between group of friends. You can think of this as reinventing Twitter if you will. So you have an actual mobile app making RESTful calls to the middle tier. Middle tier is Java implementing these RESTful services that write to (or read from) noSql database like Cassandra or MongoDB. Is there any benefit to bring some kind messaging queuing service (such as ActiveMQ or Qpid or similar) into this picture and place it between mobile app and Java middle tier?? I may understand the desire to commit messages into database in asynchronous matter, but noSql databases (both Cassandra and MongoDB) have their own queuing mechanism. Why ActiveMQ or Qpid could still be a good idea?
-
Answer:
No, adding a message queue between the mobile app and Java Web Server will not work because the mobile device will make REST calls over HTTP. Message queuing services do not use HTTP and use other protocols such as AMQP. A message queue would be useful if there are multiple components handling the middle tier. For example, with the Java web server communicating with the mobile app but not connecting to the data store directly, with other components doing that job and other processes.
Miguel Paraz at Quora Visit the source
Other answers
I believe this will not bring you any advantage in the drawing you show, because there is no advantage in direct message passing if your clients will just be polling for new data - however, if your clients were using something like HTTP long polling, where the server pushes new messages to them (and it should be, nobody likes to refresh the page/app to see if they have new notifications), then you could get something out of it. When a user sends something to somebody else, you could enqueue a message that some action has occurred so that the target thread/server immediately pushes out a notification to the connection of the receiving client. I don't know if there's a way to subscribe to events happening in a NoSQL database, but I suppose not - after all it's just a database, not your personal distributed event loop (I don't have much experience with them, so this might not be actually true). In this case you'll be making requests to the database only when the client actually requests some data, for example by taking action on the notification - much of the "live action" will be happening in ZeroMQ/ActiveMQ. I guess you could even make most of the application work only by passing messages, and use the database just for persistence (e.g. when the receiving client is not connected and to store conversation histories in case of connection problems or just for convenience). In this case the database will be just another endpoint in your message queueing system.
Vladislav Zorov
Related Q & A:
- How to Scale a Mobile App?Best solution by Stack Overflow
- Is there a way to utilize a directv receiver for local HD reception without a subscription?Best solution by Yahoo! Answers
- Does anybody have a realy cool design for a speaker box for a tj with no back seat?Best solution by Yahoo! Answers
- Does anyone know how to do a back flip on a trampoline?Best solution by Yahoo! Answers
- How long is a typical recovery from a thyroidectomy?Best solution by ChaCha
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.