Long Polling Versus WebSockets
TradeoffMidSeniorUpdated
A collaborative editor needs sub-100ms updates across users.
Short answer: WebSockets. WebSockets give true bidirectional push with low overhead.
The Two Options
A
Long polling
B
WebSockets
Drill This: Your Pick First
The Better Pick
Option B
WebSockets
WebSockets give true bidirectional push with low overhead. Long polling adds latency, reconnection cost, and load balancer headaches.
When the Other One Wins
Long polling
If updates are infrequent (every few minutes) and clients are behind hostile proxies, long polling is more reliable and simpler.