As a relational database supporting full SQL, TimescaleDB supports flexible data models that can be optimized for different use cases. This makes TimescaleDB somewhat different from most other time-series databases, which typically use "narrow-table" models.
Specifically, TimescaleDB can support both wide-table and narrow-table models. Here, we discuss the different performance trade-offs and implications of these two models using an Internet of Things (IoT) example.
Imagine a distributed group of 1,000 IoT devices designed to collect environmental data at various intervals. This data could include:
- Device metrics:
- Sensor metrics:
For example, your incoming data may look like this:
|2017-01-01 01:02:00||abc123||80||500 MB||72||335||field|
|2017-01-01 01:02:23||def456||90||400 MB||64||335||roof|
|2017-01-01 01:02:30||ghi789||120||0 MB||56||77||roof|
|2017-01-01 01:03:12||abc123||80||500 MB||72||335||field|
|2017-01-01 01:03:35||def456||95||350 MB||64||335||roof|
|2017-01-01 01:03:42||ghi789||100||100 MB||56||77||roof|
Now you can look at various ways to model this data:
Found an issue on this page?Report an issue!