1

We deployed an Azure TSI Preview ingesting messages coming from an IoT Hub. We are wandering what would be the best practice that applies when there are events that are generated by different type of devices with no intersection of properties.

Consider, as example, messages coming from a device of type A:

{
  "timestamp" : "2019-02-25T01:08:00Z",
  "devicetype" : "a",
  "windspeed" : 10,
  "airpressure" : 101300
}

and messages coming from a device of type B

{
  "timestamp" : "2019-02-25T01:09:00Z",
  "devicetype" : "b",
  "temperature" : 26.5,
  "humidity" : 22.5
}

where timestamp is the column used as the source timestamp and devicetype the column used as the Time Series ID.

Following the doc, and checking out the resulting events in the explorer, the resulting output would looks like

  timestamp            | devicetype | windspeed | airpressure | tempearature | humidity 
  2019-02-25T01:08:00Z | a          | 10        | 101300      |              |          
  2019-02-25T01:09:00Z | b          |           |             | 26.5         | 22.5     

In practice, we have devices of different types that will never share any properties. Therefore,

  • Are we going to get the same degree of performance for speed and memory allocation (blob)?
  • Are we wasting space?
  • Is there a better way to organize the events?
  • What if we change the properties and introduce a common field?

Thanks :)

alevincio
  • 23
  • 4

1 Answers1

2

Thank you for your interest in TSI. I am a Sr. Product Manager on the team.

I believe that the way you have organized your events is ok. you can also optimize using something like propertyType to reduce the number of columns.For example:

{
"deviceType" : "a"
"propertyType": "humidity"
"value": 22.5
}

This would create a table structure in your environment as follows:

propertyType     value
humidity         22.5
temperature      26.5

The structure would depend on the number of properties that you have in your environment. In the example that you have posted in the thread you can query properties directly through queries. However, if you use my approach, you will need to use a filter in the query(This may not give you the most optimal query performance if you have too many properties.)

I hope this clarifies your questions. Please let me know if I can answer any more questions.

mehrdadep
  • 972
  • 1
  • 15
  • 37
  • Thank you for the answer. On the documentation for the GA about [How to shape JSON to maximize query performance](https://learn.microsoft.com/en-us/azure/time-series-insights/how-to-shape-query-json) you mention a limit of 600 or 800 properties. What is the limit in the Preview given that there is no concept of level S1 or S2? – alevincio Mar 12 '19 at 10:15