Development notes related to Embedded Databases used in the Playground
Table of contents:
Apache IoTDB
Phase1 PoC
- Versions used for development: Apache IoTDB v1.2.2, Apache Go Client v1.1.7
- Timeseries Schema
- As there is no mechanism (that we are aware of) for a southbound feeder and WAII to negotiate/communicate a schema as a starting point a simple key/value pair schema was used within IoTDB to store VSS timeseries data. A simple schema is probably the best place to start anyway for simplicity of understanding.
The IoTDB data model supports hierarchical paths for efficiency of data at scale. The model uses a dot notation. So for example a vehicle DB may have the hierarchy root.region.model.
This causes a challenge integrating VSS node paths which also use a dot notation. For example using the VSS node path Vehicle.CurrentLocation.Longitude as the timeseries key/measurement would cause Vehicle and CurrentLocation to be used in the hierarchy. When scaled across millions of vehicles this would cause inefficiency in storage and retrieval.
A simple solution is to quote the VSS node path and is what used here.
Creating VSS aligned timeseries
Code Block |
---|
language | sql |
---|
title | Examples of creating a schema for an aligned VSS timeseries using SQL |
---|
|
CREATE ALIGNED TIMESERIES root.test2.dev1(`Vehicle.CurrentLocation.Longitude` FLOAT, `Vehicle.CurrentLocation.Longitude` FLOAT, `Vehicle.Cabin.Infotainment.HMI.DistanceUnit` TEXT)
CREATE ALIGNED TIMESERIES root.test2.dev1(`Vehicle.CurrentLocation.Longitude` FLOAT encoding=PLAIN compressor=SNAPPY, `Vehicle.CurrentLocation.Longitude` FLOAT encoding=PLAIN compressor=SNAPPY, `Vehicle.Cabin.Infotainment.HMI.DistanceUnit` TEXT encoding=PLAIN compressor=SNAPPY) |
MongoDB Realm