Architectural Breakdown & AnalysisFAANG Aligned
Real-time applications require choosing between client-initiated pull mechanisms and server-initiated push streams.
| Model | Protocol | Pros | Cons | Best Use Case |
|---|---|---|---|---|
| HTTP Short Polling | Standard HTTP | Simple implementation | Extreme server overhead & waste | Low-frequency status checks |
| HTTP Long Polling | Standard HTTP | Immediate response on data | Connection setup overhead | Legacy browser push |
| Server-Sent Events (SSE) | HTTP/2 Stream | Unidirectional, lightweight, auto-reconnect | Server-to-client only | Live dashboards, stock tickers |
| WebSockets | TCP WS | Bi-directional, sub-5ms latency | Complex scaling & connection state | Real-time chat, multiplayer games |
NOTE — Protocol Selection
Choose SSE for notification feeds where client-to-server messaging is minimal. Reserve WebSockets for bi-directional streaming applications.