I am aware of the difference between the two. Using WebSockets one can have bidirectional communication but with SSE only data can be pushed to browser. But at the same time, web sockets are heavy.
I am implementing a small game which will be played by 8-10 users simultaneously. I need to update the UI of all other players, whenever someone makes a move. Player's interaction with the game is minimal. In this case, should I go with Websockets for the two-way interaction or SSE for updating the browser and POST requests from the browser to the server whenever a player makes a move. Which will be more efficient performance and load wise on the server. My backend is in Django and I will be using Django channels for SSE or Websockets.
"Websockets and Server sent events were in the experiments measured to have very similar performance and they were measured to be the most performance efficient of the compared technologies in the experimental conditions used in this study. This suggests that to increase server performance and reduce hardware costs these technologies would be better than the other technologies compared. "
Performance comparison of XHR polling, Long polling, Server sent events and Websockets
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