System Design · Middle · Question 18 of 75
What should you use for real-time notifications that only flow from the server?
- ✓Correct answer: Server-Sent Events: a simple HTTP stream with auto-reconnect
- 2WebSocket is mandatory - SSE can't transmit data
- 3Polling every 100 ms for minimal latency
Explanation
SSE is simpler than WebSocket: it runs over HTTP, reconnects on its own and sends Last-Event-ID to catch up on missed events. WebSocket is needed when the client also sends data frequently. Polling every 100 ms creates a huge load.