Rodrigo Ruiz
Rodrigo Ruiz

Reputation: 4355

Client server communication: REST vs Socket architecture

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).

Upvotes: 0

Views: 1089

Answers (2)

Kris
Kris

Reputation: 4823

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).

Upvotes: 0

vtortola
vtortola

Reputation: 35885

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?

Upvotes: 1

Related Questions