Architecture
Events enter Kafka for durability, then fan out through Redis channels partitioned by room ID. Edge pods subscribe only to channels with local connections.
Deploy strategy: drain connections with GOAWAY before pod termination — zero message loss in practice.
Engineering details
- Backpressure — slow consumers drop to catch-up mode with snapshot resync.
- Ordering — partition key =
roomIdguarantees per-room order. - Observability — lag metrics per consumer group + connection count per pod.