Live radio for first responders
Architect and main author / 2024 - Now
Main author of the Rust backends that stream live radio from fire stations to responders' phones, for a US emergency-response platform. Opus audio goes out in 60 ms frames over WebSockets; each channel is pinned to a pod with rendezvous hashing and relayed over gRPC, pods find each other through the Kubernetes API, and if Redis goes down the service keeps running from memory.
How it works
- Authenticated channels use OAuth2/JWT or API keys. A public variant, which I built on my own, checks each channel against an external API before it accepts the connection.
- Each channel is pinned to one pod with rendezvous hashing (MurmurHash3). A feature flag switches to broadcasting to every pod.
- Stream state lives in memory with a write-through Redis cache and read replicas. When Redis is down, the service runs from memory alone.
- Channel, tenant and permission changes apply as soon as their events arrive. Audio archiving and stream reconciliation go through RabbitMQ.
- Retries with exponential backoff, automatic RabbitMQ reconnection, HTTP/2 and TCP keepalives, Prometheus metrics and a Grafana dashboard.
