· May 22, 2017 1m read

WebSockets v REST?

Most frameworks support either REST or WebSockets, and don't make it easy to switch between the two, and/or support both styles of application at the same time.  WebSockets offer many advantages over REST, eg:

- most benchmarks show WebSocket messaging to be significantly faster than over HTTP

- you break free of the HTTP Request/Response protocol limitations, allowing the server/back-end to send messages to the browser as and when it wishes, not simply when polled by the browser.  As a result your UI can respond to other events and activity that is being carried out elsewhere and by others, in real time.

Uniquely, QEWD.js  allows you to quickly, simply, but securely support either or both styles of communication with your Cache back-end.

I've once again used the excellent RealWorld initiative to provide a showcase for this - see the last paragraph here:

and then read:

..and try out the live demo!

Discussion (1)1
Log in or sign up to continue