Bidirectional Streaming

Bidirectional Streaming

gRPC, WebSocket, HTTP/2, HTTP/3, SSE, reconnect strategies, HOL blocking.

65Articles
65Topics covered
Articles in this category

All 58 articles, sorted alphabetically

ARTICLE · 01

Backpressure in Bidirectional Streams, in depth: propagating demand through relays, manual flow control in gRPC, credit protocols for WebSocket, and stall testing

How to make backpressure propagate end to end through bidirectional streams: the four flows of a relay, why each direction needs its own demand chain,…

Read article →
ARTICLE · 02

Backpressure in Streaming Systems, in depth: queue arithmetic, Reactive Streams demand, Flink credits, Kafka consumer lag and choosing to block, buffer or drop

How stream-processing pipelines handle a consumer slower than its producer: the queueing arithmetic, the block, buffer and drop choices, Reactive Stre…

Read article →
ARTICLE · 03

Backpressure architecture in bidirectional streams

Deep-dive on end-to-end backpressure: TCP/HTTP2/QUIC flow-control windows, gRPC readiness, Reactive Streams demand, WebSocket's bufferedAmount ga…

Read article →
ARTICLE · 04

QUIC connection migration architecture

Deep-dive on QUIC connection migration: Connection IDs decoupling identity from the four-tuple, path validation and anti-amplification limits, congest…

Read article →
ARTICLE · 05

Delivery and read receipts architecture

Deep-dive on delivery and read receipts in real-time messaging: server-assigned message identity, delivered and read acknowledgements flowing back ove…

Read article →
ARTICLE · 06

Real-time fanout -- delivering messages to many connections

Deep-dive on real-time fanout: the broadcast-to-many problem, the stateful connection layer (sharded WebSocket servers), the pub/sub backplane distrib…

Read article →
ARTICLE · 07

gRPC Bidirectional Streaming in Depth: Flow Control, Reconnects

gRPC bidirectional streaming in depth: HTTP/2 framing, half-close, flow control windows and backpressure, deadlines, keepalives, cancellation and reco…

Read article →
ARTICLE · 08

Heartbeats / keepalive -- detecting dead connections

Deep-dive on heartbeats/keepalive for long-lived bidirectional connections: the silent-death problem, periodic ping/pong, timeout detection, reconnect…

Read article →
ARTICLE · 09

HTTP/2 architecture, in depth: frames, stream states, HPACK, flow control and HTTP/2 as a transport for bidirectional streaming

How HTTP/2 works as a bidirectional transport: the connection preface and SETTINGS, the 9-byte frame header and frame types, the stream state machine,…

Read article →
ARTICLE · 10

Load Balancing WebSockets, in depth: L4 versus L7, connection-aware algorithms, idle timeouts, draining, rebalancing and reconnect storms

How to load balance WebSocket traffic: why a balancing decision lasts for the life of a connection, L4 versus L7 trade-offs, the Upgrade headers a pro…

Read article →
ARTICLE · 11

Load shedding on bidirectional streams

Deep-dive on load shedding for long-lived bidirectional streams (WebSocket, gRPC, WebTransport): deliberately dropping work the server cannot serve so…

Read article →
ARTICLE · 12

Load Testing Bidi Servers with k6, in depth: WebSocket and gRPC streaming scenarios, delivery latency, soak tests and reconnect storms

How to load test WebSocket and gRPC bidirectional streaming servers with k6: why connection-oriented load is different, workload sizing with a worked …

Read article →
ARTICLE · 13

Long polling

Deep-dive on long polling: the hold-and-respond cycle, cursors for reliable gap-free delivery, timeout tuning against intermediaries, scaling held con…

Read article →
ARTICLE · 14

Long-polling fallback

Deep-dive on transport negotiation with long-polling fallback: the WebSocket-to-SSE-to-long-poll ladder, the server hub that presents one transport-ag…

Read article →
ARTICLE · 15

Bidi message ordering architecture

Deep-dive on ordered delivery over bidirectional streams: sequence numbers and send buffers, receive-side reorder windows, gap detection with NACK, de…

Read article →
ARTICLE · 16

MQTT architecture

Deep-dive on MQTT: the broker-and-topic publish/subscribe model, wildcard topic filters, the three QoS levels (at-most/at-least/exactly once), retaine…

Read article →
ARTICLE · 17

Stream multiplexing -- many logical streams over one connection

Deep-dive on stream multiplexing: the HTTP/1.1 connection-per-request problem, many concurrent streams over one connection, frames and stream ids inte…

Read article →
ARTICLE · 18

Offline message queue architecture

Deep-dive on the store-and-forward offline queue that keeps bidirectional clients gap-free across disconnects: a fanout writer that appends each messa…

Read article →
ARTICLE · 19

WebSocket permessage-deflate: Compression, Context Takeover

How WebSocket permessage-deflate works: extension negotiation, window bits, context takeover vs memory, RSV1, decompression bombs and compression orac…

Read article →
ARTICLE · 20

Presence Tracking at Scale: Heartbeats, TTL and Online Status

How real-time presence (online and offline status) works: heartbeats with TTL expiry, multi-device aggregation, grace windows to stop flapping, fan-ou…

Read article →
ARTICLE · 21

QUIC bidi streams architecture, in depth: stream IDs, state machines, three layers of flow control, cancellation and HTTP/3

How QUIC bidirectional streams work: the stream ID encoding, what STREAM, RESET_STREAM and STOP_SENDING frames do, the stream and connection flow-cont…

Read article →
ARTICLE · 22

WebRTC bidi architecture, in depth: the data channel as a bidirectional transport, from SCTP streams and reliability modes to backpressure and server-terminated peers

How WebRTC data channels work as a bidirectional message transport: SCTP over DTLS over ICE, in-band DCEP versus negotiated channels, ordered and part…

Read article →
ARTICLE · 23

Bidi Security, in depth: authenticating WebSocket and streaming connections, cross-site hijacking, per-message authorisation, revocation and rate limits

A threat model and control set for long-lived bidirectional connections: handshake authentication options in browsers, Origin checks against cross-sit…

Read article →
ARTICLE · 24

Signaling architecture for real-time apps, in depth: envelopes, epochs, routing, resync, join storms and WHIP

Signaling for WebRTC apps as a distributed system: stateless workers, session store, pub/sub routing, message envelope with epochs and sequence number…

Read article →
ARTICLE · 25

Socket.IO at scale, in depth: Engine.IO sessions, sticky routing, adapters, recovery and reconnect storms

How Socket.IO works at scale: Engine.IO handshake and upgrade, sticky load balancing, Redis and Streams adapters, connection state recovery, capacity …

Read article →
ARTICLE · 26

What Is SSE? Server-Sent Events Explained

What is SSE? Server-sent events stream one-way updates over HTTP: the text/event-stream format, EventSource, auto-reconnect, SSE vs WebSocket, and LLM…

Read article →
ARTICLE · 27

Typing Indicators at Scale: Throttling, TTL and Fan-Out

How chat typing indicators work at scale: ephemeral presence over WebSockets, client throttling, TTL expiry so no typing bubble gets stuck, room fan-o…

Read article →
ARTICLE · 28

WebRTC Architecture, in depth: ICE, DTLS-SRTP, congestion control, SFU topologies and what breaks in production

How WebRTC actually moves real-time media and data: the protocol stack, offer/answer and perfect negotiation, ICE candidates and NAT traversal, TURN i…

Read article →
ARTICLE · 29

WebSocket architecture, in depth: the upgrade path, edge and application tiers, the per-connection loop, auth, backplane, backpressure, deploys and sizing

An end-to-end architecture for WebSocket services: what RFC 6455 gives you, getting the upgrade through proxies and load balancers, splitting a statef…

Read article →
ARTICLE · 30

WebTransport Architecture in Depth: sessions over HTTP/3, reliable streams and unreliable datagrams, the browser API, backpressure and when to choose it over WebSocket

A first-principles guide to WebTransport: why it exists, how a session rides on QUIC and HTTP/3, the three primitives (bidirectional streams, unidirec…

Read article →
ARTICLE · 31

WebSocket subprotocols architecture, in depth: negotiation, designing and versioning your own, routing by name, and the auth-token trick

How WebSocket subprotocols work and how to build on them: the Sec-WebSocket-Protocol negotiation rules from RFC 6455, server routing by subprotocol na…

Read article →
ARTICLE · 32

Heartbeat and Keep-Alive Strategies, in depth: choosing intervals across TCP, WebSocket, HTTP/2, gRPC, SSE and MQTT

How to design heartbeats and keep-alives for long-lived connections: the difference between keeping a path open and detecting a dead peer, interval an…

Read article →
ARTICLE · 33

HTTP/2 vs HTTP/3 Streams, in depth: head-of-line blocking, stream credit, flow control, QPACK, priorities and when each one wins

A head-to-head comparison of streams in HTTP/2 and HTTP/3: where ordering lives, transport head-of-line blocking and how QPACK can bring it back, stre…

Read article →
ARTICLE · 34

NATS JetStream for IoT, in depth: subjects, leaf nodes, streams and commands for a device fleet

Build an IoT backbone on NATS JetStream: a subject hierarchy for telemetry and commands, a leaf node per site that buffers through WAN outages, stream…

Read article →
ARTICLE · 35

QUIC Streams for Real-Time Apps, in depth: mapping game state, chat and live updates onto streams and datagrams

How to design the wire protocol of a real-time application on QUIC: what streams fix and what they do not, long-lived versus per-object streams, RFC 9…

Read article →
ARTICLE · 36

SignalR-Style Connection Patterns, in depth: hubs, transport negotiation, the hub protocol, reconnects and scale-out

How SignalR-style real-time connections work: hub RPC over a persistent connection, the negotiate step and transport fallback, the JSON hub protocol a…

Read article →
ARTICLE · 37

Socket.IO vs Native WebSocket, in depth: what each puts on the wire, what you rebuild, and how to choose

Socket.IO versus raw WebSocket from the wire up: Engine.IO framing and upgrade, the interop trap, the reconnect, heartbeat, ack and room code you writ…

Read article →
ARTICLE · 38

SSE Authentication Challenges, in depth: no headers in EventSource, cookies and CORS, ticket exchange, fetch streaming, expiry and revocation

How to authenticate Server-Sent Events when EventSource cannot send an Authorization header: cookie sessions with withCredentials and CORS, why query-…

Read article →
ARTICLE · 39

SSE Client Lifecycle, in depth: readyState, reconnect rules, hidden tabs, bfcache, sleep and wake, network changes and one stream shared across tabs

How a browser Server-Sent Events client behaves over a page's whole life: EventSource readyState and which responses stop reconnection, what the …

Read article →
ARTICLE · 40

SSE Error Handling Patterns, in depth: failure layers, in-band problem events, errors after the 200, resilient client dispatch and stopping on purpose

How to design error handling for Server-Sent Events: classify failures by layer, send typed problem events that do not collide with the browser error …

Read article →
ARTICLE · 41

SSE for LLM Streaming Responses, in depth: relaying tokens to the browser with a stable event schema, cancellation, heartbeats, unbuffered proxies and resumable generations

How to stream LLM output over Server-Sent Events end to end: why chat apps use fetch instead of EventSource, a normalised event schema over provider s…

Read article →
ARTICLE · 42

SSE Through Proxies, CDNs, and Middleboxes, in depth

Why Server-Sent Events break between server and browser: buffering, idle and total timeouts, compression and HTTP/2 headers at every hop, with verifie…

Read article →
ARTICLE · 43

SSE Observability, in depth: connection and event metrics, client telemetry, tracing and diagnosing reconnect storms

How to observe Server-Sent Events in production: why request latency and status codes mislead, connection and event metrics at the pipeline, server an…

Read article →
ARTICLE · 44

SSE Reconnection and Last-Event-ID Server Design, in depth: the browser's reconnect contract, cursor design, the resume decision, the replay race and the status codes that end a stream

How to build a Server-Sent Events endpoint that resumes correctly: what the HTML spec makes EventSource do on drops, ids and retry, how to design even…

Read article →
ARTICLE · 45

Scaling SSE, in depth: event IDs from a shared log, resume on any node, rebalancing, reconnect storms, proxies and draining

How to scale Server-Sent Events across many nodes: why SSE is stateful at scale, using a replayable shared log such as Redis Streams so event IDs resu…

Read article →
ARTICLE · 46

SSE vs WebSocket, in depth: the criteria that decide it, the SSE-plus-POST hybrid, resume semantics, three worked workloads and the cost of migrating either way

How to choose between Server-Sent Events and WebSocket by criteria rather than habit: direction and rate of traffic, binary payloads, browser authenti…

Read article →
ARTICLE · 47

WebSocket Authentication Patterns, in depth: choosing the layer, building a one-time ticket service, first-frame auth, in-band token refresh, and how Socket.IO, SignalR, Spring STOMP and API Gateway do it

A builder's guide to authenticating WebSocket connections: which layer should verify the credential for each client type, a one-time ticket servi…

Read article →
ARTICLE · 48

WebSocket Backpressure and Slow Consumers, in depth: where the bytes pile up, per-client queues, drop, conflate or disconnect, and detecting a stalled reader

How to keep one slow WebSocket client from hurting a whole server: the buffers between publisher and handler, how browsers, Python websockets, Node ws…

Read article →
ARTICLE · 49

WebSocket Debugging Tools and Techniques, in depth: a layer-by-layer method, curl handshake tests, DevTools, wscat and websocat, Wireshark with TLS keys, close codes and capture automation

A practical method for debugging WebSocket connections: isolate the failing layer, test the handshake with curl, read frames in Chrome and Firefox Dev…

Read article →
ARTICLE · 50

WebSocket Frame Format, in depth: header bits, length encodings, masking, fragmentation and a parser you can trust

The RFC 6455 WebSocket frame format bit by bit: FIN, RSV and opcode, the three payload-length encodings and the minimal-encoding rule, client masking …

Read article →
ARTICLE · 51

The WebSocket Handshake, in depth: every header, the Sec-WebSocket-Accept computation, server validation, client checks, Origin and HTTP/2 and HTTP/3 bootstrapping

The WebSocket opening handshake byte by byte: the RFC 6455 request and response headers, computing Sec-WebSocket-Accept, a tested server-side validati…

Read article →
ARTICLE · 52

WebSockets Through Load Balancers, in depth: a field guide to failed upgrades, timeout chains, lifetime limits, port exhaustion and per-proxy fixes

Why WebSockets break behind load balancers and how to find which hop is responsible: stripped upgrade headers, the idle timeout chain, maximum lifetim…

Read article →
ARTICLE · 53

WebSocket Ping/Pong Keepalive, in depth: server ping loops, read deadlines, half-open connections and the proxies in between

How to implement WebSocket ping/pong keepalive correctly on the server: why half-open TCP connections go unnoticed, the ping period and pong deadline …

Read article →
ARTICLE · 54

WebSocket Reconnection Strategies, in depth: detecting dead connections, backoff with jitter, session resume and storm control

How to build WebSocket reconnection that survives mobile networks, deploys and outages: close codes and what they mean, detecting half-open connection…

Read article →
ARTICLE · 55

Scaling WebSocket Servers Horizontally, in depth: routing a message to the node that holds the socket with connection registries, per-node inboxes, replayable streams and stale-route cleanup

The addressing problem at the heart of horizontally scaled WebSocket servers: why any process may need to reach a socket pinned to another node, broad…

Read article →
ARTICLE · 56

Scaling WebSocket Servers, in depth: per-node limits, rebalancing after scale-out, reconnect storms, fan-out sharding and autoscaling on connections

How to scale WebSocket servers horizontally: what limits a single node, why scale-out does not move existing connections and how to rebalance safely, …

Read article →
ARTICLE · 57

WebSocket Subprotocols and Extensions Explained, in depth: negotiation rules, versioning by subprotocol, permessage-deflate parameters, compression memory and oracles

How WebSocket subprotocol and extension negotiation actually works: the Sec-WebSocket-Protocol and Sec-WebSocket-Extensions handshake rules, using sub…

Read article →
ARTICLE · 58

WebSocket vs gRPC Bidi, in depth: what each puts on the wire, flow control, browsers, proxies, resume and how to choose

A first-principles comparison of WebSocket and gRPC bidirectional streaming: framing and contracts, flow control and slow consumers, browser support a…

Read article →

Views are my own and do not represent any employer, past or present.