The server side mainly includes a query engine, which is used to process all requests from users and distribute them to the corresponding management components.
IoT data management has the following characteristics and requirements:
IoT devices are usually managed hierarchically, such as using the four layers of "group - power plant - equipment type - equipment number" to locate an IoT device.
Complex equipment may be composed of multiple subsystems. For example, a wind turbine equipment is composed of a blade system and a generator system, and the blade system includes measuring points such as power and wind speed. The industry often uses a nested BOM structure to describe the device composition structure.
IoT devices are upgraded frequently, and devices can be accessed at any time, requiring a data model that can be flexibly modified.
Apache IoTDB initially adopts a tree-shaped IoT model to manage time series data, and manages the equipment asset hierarchy and composition structure in a unified manner.
A modeling example of the Internet of Vehicles is shown on the right side of the figure below, and the left side is a legend.
There are four main concepts: storage group, device, measurement, and timeserie.
Storage group: A group of devices, which are stored in a directory on disk, and are physically separated from different storage groups.
Device: a physical entity, including an attribute to indicate whether its measurements are collected at the same time, that is, whether the data writing time can be shared.
Measurement (metric points, variables, columns): measurement information recorded by the detection device in the actual scene.
Timeseries: A measurement of a device locates a timeseries.
The attribute information and composition information of the equipment are mapped into one tree structures, the equipment information of the physical world is naturally mapped to the information world, and the cost of understanding is reduced.
IoTDB is the first timeseries database that fuses aligned and nonaligned timeseries models. For the scene where measurements are collected at the same time, the aligned timeseries model can be used; for the scene where the measurements are collected independently, the non-aligned sequence model can be used.
By adapting to different collection modes, not only the cost of time column storage can be reduced, but also the efficiency of data reading and writing can be improved.
Many scenes have a large number of devices of the same type, and the components and measurements of these devices are the same, as shown in the following figure.
To this end, IoTDB provides a device template function. For a batch of devices of the same type, a template can be created in advance and mounted on a tree node. Devices under this node can share this metadata information, saving metadata overhead.
The tree model can easily add child nodes without affecting the original structure. Compared with relational databases, it can greatly reduce the cost of model expansion. Users can dynamically increase equipment and physical quantities.
Apache IoTDB supports the definition of metadata on the device side. Metadata can be automatically created when data is written, and there is no need to manually create metadata.
Such as InfluxDB：Measurement，tagkey1=tagv1, tagkey2=tagv2, field1, field2, field3
Convert rule：measurement - tagv1 - tagv2 - field
InfluxDB SQL：insert server,rack=r1,computer=c1,module=cpu temperature=25.8 1
Data model in IoTDB：root.r1.c1.cpu.temperature
SQL in IoTDB：insert into root.r1.c1.cpu(time, temperature) values(1, 25.8)
The schema of a table is Time, tagkey1, tagkey2, tagkey3, field1, field2...
The conversion is the same as tag model.
Such as Pi: a point named as a.b.c，in IoTDB could be root.a.b.c.