Best Schema for Tree-like Datastructure

Hello Influx Community,

I am new to the world of time series database and I’m currently designing a schema for a simple telemetry application. However the data consists of a lot of different data points for the same values.

For example:
I have measurements for voltage and temperature. I have a set of strings (i.e. strands, in an electrical terminology) that each has a set of modules which, in turn has a set of cells. (Imagine a battery storage system). For each of the levels I have a measurement. So there is a measurement with voltage and temperature for the whole string, a measurement for Module 1-x and a measurement for each cell 1-x of Module 1-x.

The question is: Do I group the measurement by value (i.e. temperature) and then add fields for each subgroup (S1M1C1, S1M1, S1). Or do I store everything simple with two fields (voltage, temperature) and distinguish by tag. The former approach seems simple because I can simply send one large query with all the data from a measurement. The retrieval over mean values between the different fields (mean of all voltages over M1-x) seems more complicated though. The latter approach seems more appealing to me as a traditional programmer, but will most likely result in a lot of entries, since I need a separate series for each single entry. Meaning a single measurement over the whole system would result in a large set (40+) of datapoints with different series but the same timestamp.

So in summary: Do I prefer large sets of fields for a single point or large set of points with a small number of fields.


Thanks for your question.
Tags are indexed, fields are not. So I recommend your idea of “I store everything simple with two fields (voltage, temperature) and distinguish by tag”.