Design a High-Throughput Smart Home Telemetry Ingestion System
1. Requirements
- Functional: Accept streaming telemetry (temperature, status) from 10 million connected devices (e.g., hybrid Wiz, Xiaomi, and custom setups).
- Non-Functional: 99.99% availability, latency under 200ms for critical alerts.
2. Component Breakdown
- Edge Gateway: Handles local MQTT termination to reduce cloud round-trips.
- Ingestion Layer: Load-balanced WebSocket servers feeding into a Kafka cluster.
- Storage: Time-Series Database (TSDB) for metrics, Document DB for device states.
3. Tradeoffs & Bottlenecks
- Using MQTT over WebSockets reduces header overhead, but requires keeping millions of stateful connections open at the load balancer level.