Communication & APIs
A persistent, bidirectional communication channel between client and server over a single TCP connection — the standard for real-time web features.
WebSocket is a protocol that upgrades an HTTP connection into a persistent, full-duplex TCP channel. Once established, both client and server can send messages independently and at any time, without the overhead of new HTTP requests. This is fundamentally different from request/response protocols and is essential for real-time features: chat, live notifications, collaborative editing, multiplayer games, live dashboards, and trading interfaces.
WebSocket connections are stateful and long-lived, which complicates load balancing (sticky sessions or external state like Redis pub/sub are typically needed), scaling (each server holds open connections — file descriptor and memory limits matter), and deployment (a graceful restart must drain connections). Modern alternatives or complements include Server-Sent Events (SSE) for one-way server-to-client, WebRTC for peer-to-peer, and HTTP/3 streams.
Production WebSocket systems usually pair with a pub/sub broker (Redis, NATS, Kafka) so any application server can deliver a message to any connected client regardless of which server holds the socket.
Use WebSocket whenever the server must push messages to clients with low latency: chat, notifications, live updates, real-time collaboration, gaming.
WebSocket complicates infrastructure (sticky load balancing, connection draining, state). For purely server-to-client use cases, SSE is often simpler. For request/response, regular HTTP is much easier to operate.
A messaging pattern where publishers emit messages to topics without knowing who consumes them, and subscribers receive messages from topics they care about.
A component that distributes incoming network traffic across multiple backend servers to maximize throughput, minimize response time, and avoid overload.
An architectural style for web APIs based on HTTP verbs (GET, POST, PUT, DELETE) acting on resources identified by URLs.
A high-performance RPC framework using HTTP/2, Protocol Buffers, and code generation for type-safe, low-latency service-to-service communication.
A query language for APIs that lets clients request exactly the fields they need in a single request, eliminating over- and under-fetching.
A buffer that holds messages between producers and consumers, enabling asynchronous processing and decoupling of services.