Hourly and daily rollups for smart thermostats
Your task
Design the data pipeline behind the energy history charts in a smart thermostat app. 60,000 thermostats each send a reading every 5 minutes: indoor temperature, set point, humidity, and how many seconds heating or cooling ran in that interval. Homeowners see charts for the last day in 5-minute detail, the last month by hour, and the last two years by day, including total heating and cooling hours. A thermostat that loses Wi-Fi buffers up to 24 hours of readings and sends them when it reconnects. Raw readings are kept for 30 days. Describe ingestion, storage, how rollups are built and kept correct when late readings arrive, and how the charts are served.
It covers
- Time series rollups
- Late data
- Retention