System Design · Junior · Question 24 of 75

When should you choose WebSocket?

Explanation

WebSocket keeps a persistent connection, and both sides can send messages at any time. The cost is persistent connections on the server, reconnections and scaling. For a server-only stream, SSE is simpler.

Further reading

Problem with a question

System Design · Junior · question 24

Test yourself

Take the System Design · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz