Web Sockets
WebSockets is a communication protocol that provides a persistent, full-duplex connection between a client and server over a single TCP connection, allowing both sides to send messages to each other at any time without the overhead of repeated HTTP requests.
29 resources across 4 libraries
Glossary Terms(3)
Service Worker
A service worker is a JavaScript script that a browser runs in the background, separate from a web page, enabling features like offline caching, push notificat…
Web Sockets
WebSockets is a communication protocol that provides a persistent, full-duplex connection between a client and server over a single TCP connection, allowing bo…
Server-Sent Events
Server-Sent Events (SSE) is a web standard that lets a server push a continuous stream of text-based updates to a client over a single, long-lived HTTP connect…
Study Notes(16)
Socket.IO vs WebSockets
A comparison of Socket.IO's higher-level abstraction against the raw WebSocket API/protocol, covering compatibility, features, and when to choose each.
Backpressure in WebSockets
How to detect and handle slow consumers on a WebSocket connection before unbounded buffering leads to memory exhaustion or unresponsive clients.
Scaling WebSockets Horizontally
How to run WebSocket servers across many instances when every connection is a long-lived, stateful process pinned to one machine.
WebSockets Behind a Load Balancer
How to correctly configure load balancers, proxies, and timeouts so WebSocket handshakes and long-lived connections survive in production.
WebSockets in the Browser
A practical guide to the native browser WebSocket API — connecting, sending and receiving messages, handling reconnection, and working with binary data efficie…
WebSockets Interview Questions
Common WebSockets interview questions with clear, technically grounded answers covering the protocol, scaling, security, and comparisons to alternatives.
WebSockets Quick Reference
A condensed reference covering the WebSocket API, handshake headers, close codes, and common patterns for fast lookup while building or reviewing real-time fea…
WebSockets vs HTTP Polling
A comparison of WebSockets against short and long HTTP polling techniques for achieving near-real-time updates in web applications.
WebSockets vs Server-Sent Events
Understanding when to choose bidirectional WebSockets versus the simpler, unidirectional Server-Sent Events (SSE) protocol for server-to-client streaming.
WebSockets vs WebRTC
A practical comparison of WebSockets and WebRTC, covering their transport models, connection setup, and when to reach for each in a real-time application.
WebSockets with Python
Build asynchronous WebSocket servers and clients in Python using the `websockets` library and asyncio, and integrate real-time endpoints into a FastAPI app.
WebSockets with Redis Pub/Sub
How Redis Pub/Sub lets a cluster of WebSocket servers broadcast messages to clients connected to any instance, and where it falls short.
What Are WebSockets?
An introduction to the WebSocket protocol, a persistent, full-duplex communication channel over a single TCP connection used for real-time web applications.
WSS and TLS for WebSockets
How TLS secures WebSocket connections, from certificate management to termination patterns in production infrastructure.
Proxying WebSockets with Nginx
Configure nginx to correctly upgrade and proxy long-lived WebSocket connections, including timeouts and load-balancing considerations.
WebSockets and Long Polling
Compares techniques for pushing real-time updates from server to client, from wasteful short polling through long polling to full-duplex WebSocket connections.
Cheat Sheets(1)
Interview Questions(9)
How Would You Design a Food Delivery System?
A food delivery system is a three-sided marketplace connecting customers, restaurants, and delivery drivers, built around order management, real-time location…
How Would You Design Slack?
Design Slack as a set of channel-partitioned messaging services backed by persistent WebSocket (or long-poll fallback) connections, a fanout write path that ap…
How to Design a Chat Presence System
A presence system tracks whether each user is online, offline, or away by having clients maintain a persistent connection (WebSocket) with periodic heartbeats…
How to Design a Group Chat System
A group chat system stores each group's membership and messages durably, fans out new messages to every online member's connection via a messaging service, and…
How to Design a Collaborative Document Editor
A collaborative document editor (like Google Docs) lets multiple users edit the same document simultaneously by converting each keystroke into an operation, br…
How to Design a Polling System?
A polling system (like Slido or Mentimeter) is designed around a write-heavy vote-ingestion path decoupled from a read-heavy results path, using an append-only…
How to Design a Real-Time Analytics Dashboard?
A real-time analytics dashboard is designed around a streaming ingestion pipeline that continuously aggregates raw events into pre-computed rollups at multiple…
How Do WebSockets Scale in a Distributed System?
WebSockets scale in a distributed system by keeping the persistent connection itself pinned to one server while offloading cross-server message delivery to a s…
WebSockets vs Server-Sent Events: When to Use Each?
WebSockets provide a full-duplex connection where both client and server can send messages at any time over one persistent socket, while Server-Sent Events (SS…