WebSocket & Real-Time Vocabulary: 25 Terms for Real-Time Applications
Learn the essential vocabulary for real-time applications — WebSockets, SSE, long polling, Socket.IO, heartbeat, STOMP, WebRTC, and more. With real developer examples.
Real-time features — live chat, collaborative editing, live dashboards — are no longer optional extras. They are expected. If you work on any system that pushes data to a browser or a mobile client, you need to speak the language of real-time communication fluently. This guide covers 25 essential terms, from the fundamentals of WebSocket connections to the nuances of backpressure and protocol choices.
WebSocket Fundamentals
WebSocket
A WebSocket is a communication protocol that provides a persistent, bidirectional channel between a client and a server over a single TCP connection. Once established, either side can send data at any time without the overhead of a new HTTP request.
“We migrated the notifications from polling to WebSocket — latency dropped from two seconds to under 50 milliseconds.”
Handshake / HTTP Upgrade
WebSocket connections begin with an HTTP upgrade handshake. The client sends a standard HTTP request with the header Upgrade: websocket. If the server agrees, it responds with 101 Switching Protocols and the connection upgrades from HTTP to the WebSocket protocol.
“The connection is failing at the handshake — check that the reverse proxy is forwarding the
Upgradeheader.”
Full-Duplex
Full-duplex means both sides can send and receive messages simultaneously, independently of each other. This is what distinguishes WebSocket from HTTP, where the client must always initiate a request before the server can respond.
“With full-duplex, the server can push a notification the moment an event happens, without waiting for the client to ask.”
Connection Lifecycle
A WebSocket connection passes through four events:
- open — connection established
- message — a message has arrived
- close — connection closed (with a code and reason)
- error — something went wrong
“Always handle the
closeevent — don’t assume the connection stays alive forever. Reconnect logic is essential.”
Message Framing
Message framing is how WebSocket wraps data into frames for transmission. Text frames carry UTF-8 strings; binary frames carry raw bytes. The protocol also has control frames for ping/pong and close.
Alternatives to WebSocket
Server-Sent Events (SSE)
Server-Sent Events is a simpler, one-way protocol where the server streams events to the client over a persistent HTTP connection. The client cannot send messages back on the same channel — it uses separate HTTP requests.
“For a live activity feed that only shows updates from the server, SSE is simpler than WebSocket and works fine over HTTP/2.”
Long Polling
Long polling is a workaround for environments where persistent connections are difficult. The client sends an HTTP request; the server holds it open until data is available, then responds. The client immediately sends another request.
“We used long polling as a fallback for corporate networks that block WebSocket upgrades.”
Short Polling
Short polling is the naive approach — the client sends a new HTTP request on a regular interval (every second, every five seconds). Simple to implement but inefficient for high-frequency updates.
Socket.IO Concepts
Rooms
In Socket.IO, a room is a named channel that sockets can join. The server can emit to everyone in a room without tracking individual connections manually.
“Each document in the collaborative editor has its own room. When a user edits, we broadcast the change to everyone in that document’s room.”
Namespaces
A namespace is a communication channel that shares the same underlying connection but is logically separated. Different parts of an application can use different namespaces.
“We put the admin dashboard on the
/adminnamespace so its events are completely isolated from the user-facing/appnamespace.”
Reliability and Performance
Heartbeat / Ping-Pong
A heartbeat is a regular signal sent between client and server to confirm the connection is still alive. WebSocket has built-in ping and pong control frames for this purpose. If a pong is not received in time, the connection is considered dead.
“We set the heartbeat interval to 30 seconds — if three consecutive pings go unanswered, the server closes and cleans up that connection.”
Backpressure
Backpressure occurs when a sender pushes data faster than a receiver can process it. In real-time systems, unchecked backpressure causes memory growth, dropped messages, or connection failure.
“The export job was streaming rows so fast the client couldn’t keep up — we had to implement backpressure by pausing the stream until the client acknowledged each chunk.”
Reconnection Logic
Reconnection logic is the client-side code that automatically tries to re-establish a dropped connection, typically with exponential backoff.
“Always implement reconnection with exponential backoff — instantly retrying on disconnect will hammer the server during an outage.”
Protocols and Patterns
STOMP Protocol
STOMP (Simple Text Oriented Messaging Protocol) is a higher-level messaging protocol often used on top of WebSocket. It provides concepts like subscriptions, destinations, and acknowledgements — similar to a lightweight message broker.
“We use STOMP over WebSocket with Spring’s message broker so clients can subscribe to specific topic destinations.”
Presence
Presence is the concept of tracking which users are currently connected and potentially what they are doing (typing, viewing a document, idle). Common in collaborative tools and chat applications.
“The green dot next to a user’s name is driven by presence data — the server broadcasts join and leave events to all connected clients.”
Channel
A channel is a logical stream of events that clients subscribe to. The term is common in libraries like Pusher and Ably, and is conceptually similar to a Socket.IO room.
“Subscribe to the
orderschannel to receive real-time order status updates.”
Dark Launch vs Live Connection
A dark launch in real-time context means establishing the WebSocket infrastructure and processing events internally, without exposing results to users — used to validate the system under real load before going live.
WebRTC
WebRTC Data Channel vs WebSocket
WebRTC is a browser API for peer-to-peer communication. A WebRTC data channel carries arbitrary data directly between two browsers without going through a server (after signalling). WebSocket always goes through a server.
“For the file-sharing feature we used a WebRTC data channel — the file goes directly from one browser to the other, not through our servers.”
Common Real-Time Phrases
| Phrase | Meaning |
|---|---|
| ”The socket dropped” | The persistent connection was lost |
| ”We’re broadcasting to the room” | Sending a message to all clients in that group |
| ”The client missed messages” | Events were sent while the client was disconnected |
| ”Implement at-least-once delivery” | Re-send if no acknowledgement is received |
| ”The upgrade failed” | Server or proxy rejected the WebSocket handshake |
| ”We need to debounce emissions” | Don’t send an event on every keystroke — batch them |
| ”Connection churn is high” | Many connect/disconnect cycles — investigate the client |