๐Ÿ“ก Realtime: WebSockets, SSE, long polling

TechDirectionUse case
Short/long pollingClient pullsSimple, fallback
SSEServer โ†’ client over HTTPNotifications, LLM token streaming โญ, live scores
WebSocketsBidirectionalChat, collaborative editing, live seat maps
WebTransport / QUICBidirectional, multiplexedEmerging
gRPC streamingService โ†” serviceInternal streams

Scaling concerns

  • Sticky sessions vs a shared pub/sub (Redis pub/sub, Kafka, NATS) to fan out across nodes
  • Connection limits per node (file descriptors, memory per connection)
  • Heartbeats, reconnection with backoff, resuming from the last event ID
  • Presence systems

๐Ÿงช Labs (๐ŸŸข warm-up โ†’ ๐ŸŸก core โ†’ ๐Ÿ”ด hard โ†’ โšซ boss)

  • ๐ŸŸก SSE token streaming with Last-Event-ID resume
  • ๐Ÿ”ด Fan-out across 3 orbit-stream replicas via Redis pub/sub
  • โšซ 5,000 concurrent SSE connections: measure memory per connection and tune timeouts

๐Ÿง  Cognitive tasks

  • Predict which proxy setting breaks a 5-minute stream first

๐Ÿ›ฐ๏ธ Orbit integration

  • orbit-stream: tokens + run events to orbit-web; the approvals inbox live updates

Go deeper

โš™๏ธ Network Stack Internals ยท Envoy Internals