0

What are the advantages and disadvantages of using only socket based communication vs a hybrid of REST and socket (using socket only when bidirectional communication is necessary, like receiving messages in a chat).

When I say only socket, I mean that instead of sending a GET request asking for /entities, I'd send update_needed and the server would send a push via socket.

My question is not really about performance, it's more about the concept, like delegate vs block/lambda (using socket would be like the delegate concept and REST is more like block).

Rodrigo Ruiz
  • 4,248
  • 6
  • 43
  • 75

2 Answers2

1

It all boils down to what type of application and level of scalability you have in mind.

WebSocket/REST: Client connections?

How to handle CQRS from a client-side perspective

Hard downsides of long polling?

Community
  • 1
  • 1
vtortola
  • 34,709
  • 29
  • 161
  • 263
0

The main reason why I wouldn't use WebSockets in any major project is simply that still many users don't use a modern browser that support them. Namely IE 8 and 9 don't support them and both together still have a market share of over 20 % (Oct 15).

Kris
  • 4,595
  • 7
  • 32
  • 50