๐ก Realtime: WebSockets, SSE, long polling
| Tech | Direction | Use case |
|---|---|---|
| Short/long polling | Client pulls | Simple, fallback |
| SSE | Server โ client over HTTP | Notifications, LLM token streaming โญ, live scores |
| WebSockets | Bidirectional | Chat, collaborative editing, live seat maps |
| WebTransport / QUIC | Bidirectional, multiplexed | Emerging |
| gRPC streaming | Service โ service | Internal 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-IDresume - ๐ด 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