Skip to content

Introduction

TSGrid is essentially a key value store, optimised for time series data. TSGrid supports "classic" time series data points (those with a single timestamp) along with interval/duration data points (from and until timestamps). TSGrid is not a relational database, it does not support joins or foreign key constraints.

When to use TSGrid

TSGrid is not a general purpose database and is certainly no replacement for a RDMS. It is best suited for time series data, especially metering or IOT style data. TSGrid uses a simple key structure:

(sensor id + timestamp) or (sensor id + from timestamp + until timestamp)

Given this key structure it should be apparent that TSGrid is not suited to queries that key on something other than a sensor id and time dimension. In general it's best to keep all non time series data in a relational database and use column to map to records in TSGrid. For example, assuming you want to record smart meter data you could use a relational table to record data about meters with a pointer to the TSGrid identifier:

id customer_id mpan latitude longitude tsgrid_id
1 1 S 03 123 456 51.5074 0.1278 1
2 1 S 03 123 456 51.5074 0.1278 2