When I joined CoolPlanet, everything I touched was grounded in time-series data. Sensor readings, equipment states, billing intervals, schedules. It soon became my bread and butter.
The starting point is the structure: every reading has two parts, a timestamp and a value.
Timestamp
A timestamp pins a reading to an absolute moment in time. To do that unambiguously you need date, time, and timezone.
I've worked with customer data from sites all over the world. Timezones have given me plenty of headaches over the years. The reasons are well outside the scope of this article, but Zain Rizvi's falsehoods programmers believe about time zones is a good place to start.
Interval
The duration between consecutive readings is the interval. Same underlying signal, different intervals, different stories.
Same week of temperature data, sampled at different intervals. Coarser intervals lose the daily swing. Drag across the chart to zoom in.
Value
Value types vary by source. The four you'll meet most often are numeric, boolean, period, and string. Each constrains what folding operations make sense; for the deep dive on folding, see Folding and Interpolation.
Pick a value type to see what the data looks like and which folding operations make sense.
The most common format. The value is a number, often with an associated unit. Example: room temperature.
| timestamp | Room Temperature |
|---|---|
| 00:00 | 20.1 °C |
| 00:05 | 20.4 °C |
| 00:10 | 20.6 °C |
| 00:15 | 20.9 °C |
| 00:20 | 21.0 °C |
| 00:25 | 20.7 °C |
| 00:30 | 20.3 °C |
| 00:35 | 19.8 °C |
| 00:40 | 19.5 °C |
| 00:45 | 19.6 °C |
| 00:50 | 19.9 °C |
| 00:55 | 20.2 °C |
| 01:00 | 20.4 °C |
Numeric data folds cleanly. Plenty of operations apply (sum, count, percentiles, standard deviation, and more); a few examples for the data above.
- Average20.3 °C
- Minimum19.5 °C
- Maximum21.0 °C
Why it matters
None of this is rocket science, but the distinctions earn their keep further down the pipeline. Storage layers fold differently depending on the value type. Charts have to render booleans and strings as steps, not lines. Knowing what kind of value you're holding is the first thing you reach for when something doesn't look right.