System design: large-scale temperature sensor collection and visualization
Design a system to collect and display temperature data from a very large number of sensors distributed across a wide geographic area (e.g., Washington State).
Inputs / devices
-
1 million to 10 million
temperature sensors, roughly uniformly distributed.
-
Sensors are
low-cost and simple
.
-
Sensors
do not support mesh networking
.
-
Sensors send readings to the backend via
HTTP
(both sides have IP addresses).
-
Temperature changes slowly, but the system must be able to
track any sensor’s temperature over time at 10-second granularity
.
Outputs / product requirements
-
A
near real-time temperature distribution map
for a Web UI.
-
At ~1M sensors, the UI can show roughly
1 sensor per pixel
on a 4K display.
-
Support queries over a time range (e.g.,
1 day
or
1 year
) to retrieve:
-
current temperature
-
minimum temperature
-
maximum temperature
-
The system should run
reliably for years
.
What to cover
-
High-level architecture, APIs, storage, and data flow.
-
Scalability, reliability, and operational concerns.
-
How you serve both near-real-time visualization and long-range historical queries.