Today, I’m revisiting client-server communication mechanisms. The main methods are outlined in the table below for easier understanding.

MechanismBased onDirectionProsConsTypical Use Cases
PollingHTTP/1.xClient → Server• Very simple to implement
• Works everywhere
• High latency (depends on interval)
• High overhead (many HTTP headers & TCP handshakes)
• Wastes resources
Periodic updates, legacy apps
Long PollingHTTP/1.xPseudo Client ⇄ Server• Lower latency than polling
• Compatible with firewalls/proxies
• Easy fallback when WebSocket is blocked
• Still request/response per message
• Server must manage many hanging connections
• Not truly bidirectional
Early chat apps, push notifications
SSEHTTP/1.x (text/event-stream)Server → Client• True server push
• Auto-reconnect & last-event-id support
• Lightweight over HTTP
• Easy to use (EventSource API)
• One-way only (server → client)
• Limited binary support
• No IE support
News feeds, stock tickers, real-time dashboards
WebSocketTCP + HTTP upgradeServer ⇄ Client• Full duplex (true bidirectional)
• Low latency, small header overhead
• Good for interactive apps
• More complex to implement
• Needs heartbeat/keep-alive
• Might be blocked by some proxies/firewalls
Chat, online gaming, collaborative apps
QUIC / HTTP/3UDP + TLS (IETF QUIC)Server ⇄ Client• Multiplexing without head-of-line blocking
• 0-RTT connection setup
• Built-in encryption
• Mobile friendly (connection survives IP/port change)
• More CPU usage (UDP + TLS overhead)
• Middlebox/proxy compatibility issues (still evolving)
Modern web (HTTP/3), video streaming, mobile apps
Share:

Leave a Reply

Your email address will not be published. Required fields are marked *

It might take a few hours to show up the new comment because of our caching system.

This site uses Akismet to reduce spam. Learn how your comment data is processed.