Reputation: 1594
AFAIU most javascript apps out there interact with the server via ajax which is a form of http. Suppose we were to make a javascript app that interacts with the server by exchanging messages through Amazon Simple Queue Service or some other such message queue service. What would be the pros and cons of that vs the http approach?
Upvotes: 3
Views: 450
Reputation: 4733
The single biggest difference between an AJAX-only approach and something like SQS is persistance.
In an AJAX system, both your client and server must be up at the same time, because if your client were to shut down, in-flight messages might be "lost". The SQS, like many queueing systems, decouples that, and adds a layer of processing flexibility (which might not be required).
My application can now put messages on the queue, at any time, and a server can take them off and process them, but while they are now both dependant upon the queue, they are not directly dependant upon each other.
A simple analogy might be the phone - if I call you and you do not answer, we are done. But if you have a messsage machine, I can leave one or more messages that you can collect at your convenience.
Upvotes: 1