I have a single page application that currently uses ajax and REST for talking to the server. I structure the code mostly using promises and deferreds, and I use a pubsub broker to communicate between components. In general, the code is structured to follow Zakas' suggestions for scalable application architecture.
I'd like to move at least some of the interaction with the server into websockets both for performance and ease of development. Some specific interactions I plan to change to use websockets are:
My question is:
Thanks.
EDIT
Hera are some related questions I found after I submitted this. These deal most closely with the last part of my question (does going 100% websockets make sense).
As I see it, there are synergies, technical and conceptual advantages of being able to do both PubSub and RPC over a single (WebSocket based) protocol. In fact, we've been developing and are using such a protocol: WAMP.
Here is a FAQ entry of why one protocol, and a blog post that tells a real-life war story of migrating a classical Ajax based to a full WebSocket based solution which is running on WAMP, Autobahn and Crossbar.io.
Disclosure: I am original author of WAMP, Autobahn and Crossbar.io and work for Tavendo.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With