KatInterview

Design a High-Throughput IoT Telemetry Ingestion Pipeline

System DesignModel answer
MediumModel answerSystem Designdistributed-systemsstreamingkafka

Last updated

Design a backend that ingests millions of concurrent device data streams, separating critical alerts from bulk telemetry while explicitly reasoning through availability, scalability, and maintainability trade-offs.

Context

A large fleet of connected devices — think smart sensors, industrial equipment, or consumer electronics — continuously streams health and status signals to a central cloud backend. Each device emits a small payload (roughly 1 KB) every 10 seconds containing readings like temperature, power draw, component status, and any active fault codes.

Your task is to design the backend ingestion and processing service for this platform.

Functional Requirements

  1. Accept a continuous stream of device telemetry over persistent connections (gRPC, MQTT, or WebSocket are all reasonable choices).
  2. Detect and route critical safety or fault signals to an alert dispatcher within 1 second of receipt.
  3. Make fleet data available to operational dashboards (near-real-time) and downstream batch analytics jobs.

Scale

DimensionTarget
Connected devices5,000,000 active
Average ingress500,000 messages/sec
Peak ingress1,000,000 messages/sec (~1 GB/s)
Ingestion ack latency< 100 ms
Critical alert latency< 1 second end-to-end
Critical path availability99.99%
General telemetry availability99.9%

What to Address

Your answer should cover architecture, data flow, storage choices, and — critically — how you reason through the following three tensions:

  1. Availability vs. Consistency: How do you handle network partitions between devices and your ingestion layer? What guarantees do you offer for critical alerts versus routine metrics?
  2. Scalability vs. Maintainability: At 1 million RPS, it is tempting to over-engineer with bespoke caching layers and finely sliced microservices. How do you keep the architecture understandable and operable while still handling the load?
  3. Backpressure and Failure Isolation: How does the system protect itself when a downstream store degrades, without silently dropping critical alerts?

You are expected to justify your choices, call out trade-offs explicitly, and identify what you would cut or simplify to reduce operational burden.

Hints

Hint 1

Start by deriving the numbers you will need: raw bytes per day, broker count, gateway node count. These estimates shape every major decision before you draw a single box.

Hint 2

The most important structural choice is whether critical alerts and bulk telemetry share the same write path. Think about what happens to alert latency if the high-volume path is under backpressure.

Hint 3

For availability vs. consistency, classify each data type separately. Routine heartbeats and critical fault codes have very different tolerance for loss, duplication, and ordering — design their guarantees independently rather than applying one model to both.