30

Which one's better: Socket.IO or SockJS and what are the biggest differences?

How difficult is it to rebuild a completely ajax based page into a node.JS / socket.io based page? Do I have to recode absolutely everything? Are there any good tutorials on how to do this? Is it worth to do it (in your opinion)?

Chris Seymour
  • 75,961
  • 24
  • 144
  • 187
Patrick DaVader
  • 2,023
  • 4
  • 22
  • 34
  • You shouldn't simply change all PULLs to PUSHs. There is a reason that both exist. Only use pushing content if it's necessary or useful for the user experience. – Alp Jun 03 '12 at 18:50
  • Try to break apart your questions and make them less 'objective'.. Possibly show any research on the subject you have already done (this is to avoid getting your issue closed as non-constructive) – rlemon Aug 29 '12 at 19:10
  • 3
    There is a thread about differences between SockJS and Socket.io on sockjs mailing list, maybe it'll help: https://groups.google.com/forum/#!topic/sockjs/lgzxVnlth54/discussion – Marek Apr 28 '12 at 17:39

1 Answers1

18

SockJS has more server-side options available. If you don't want to be tied to Node.js, then it may be an option. The scaling seems to work best, from some benchmarks using PyPy to host the server-side portion.

socket.io has more transport options, which include Flash. Even if you don't like flash, it does have the option for a real WebSocket transport, which may work better depending on your implementation desires.

The fact is, either will get the job done, it just depends on your desires. I would suggest creating a trivial application in each, and see if one's APIs feel more natural to you.

Personally, I'm more inclined to use socket.io ... I will also say that if you need to scale using clusters, you will probably also need to map out a strategy to use a pub/sub server (such as redis) as different requests may come to different processes that don't share memory state.


Also worth noting, is there is a similar framework for .Net called SignalR ...

Tracker1
  • 17,841
  • 10
  • 75
  • 104