Skip to content

Latest commit

 

History

History
122 lines (77 loc) · 4.37 KB

iotdb.md

File metadata and controls

122 lines (77 loc) · 4.37 KB

TSBS Supplemental Guide: Apache IoTDB

This should be read after the main README.

Apache IoTDB (Database for Internet of Things) is an IoT native database with high performance for data management and analysis, deployable on the edge and the cloud. For more details about Apache IoTDB, please take a look at: https://iotdb.apache.org/

This supplemental guide explains how the data generated for TSBS is stored, additional flags available when using the data importer (tsbs_load_iotdb), and additional flags available for the query runner (tsbs_run_queries_iotdb).

Data format

Data generated by tsbs_generate_data for IoTDB is serialized in a "pseudo-CSV" format, Each reading consists of a row, the first item is the operation type represented by 0, 1.

  • 0 means create timeseries with tags, the format is:
    • 0,database name,deviceID,tag,tag key and tag values
  • 1 means insert data, the format is:
    • 1,database name,deviceID,timestamp,insert values

deviceID describes the storage path which is composed of several nodes. IoTDB uses storage groups to manage data. For example, in test case devops, if measurementName is cpu while hostname tag is host_0, then deviceID is root.cpu.host_0. hostname in devops test cases is one of primary keys, and each hostname specifies a unique device, so it's selected to be part of deviceID. But other tags are not so important and their values do not change during whole testing, so they are designed to be stored in a node named _tags as attributes. For more details about how IoTDB manage attributes of a node, please take a look at Timeseries Management.

The unit of timestamp in generated data is nanosecond, but it will be converted into millisecond before insert into database.

An example for the cpu-only use case:

0,cpu,host_0,tag,'hostname'='host_0','region'='eu-west-1','datacenter'='eu-west-1c','rack'='87','os'='Ubuntu16.04LTS','arch'='x64','team'='NYC','service'='18','service_version'='1','service_environment'='production'
1,cpu,host_0,1677628800000,58,2,24,61,22,63,6,44,80,38

tsbs_load_iotdb Additional Flags

IoTDB related

-host (type: string, default: localhost)

Hostname of IoTDB instance.

-port (type: string, default: 6667)

Which port to connect to on the database host.

-user (type: string, default: root)

The username of user who connect to IoTDB.

-password (type: string, default: root)

The password for user connecting to IoTDB.

-timeout (type: int, default: 0)

Session timeout check in millisecond. After session config initialization, client will try to get response from database server to make sure the connection is established. This argument is the session timeout in millisecond. Use 0 for no timeout.

-records-max-rows (type: int, default: 0)

Session use insertRecords to insert data into database. This argument is the max size (max rows) of records. Use 0 for no limit. If this argument is 0, tsbs_load_iotdb will insert all data in a batch at one time, that means the behavior is equal to setting this arguments as batch-size.

Warning! If this value is set too small, the insertion performance will be seriously reduced.

-aligned-timeseries (type: bool, default: true)

Using aligned timeseries for all metrics if set true. That means using InsertAlignedRecords, which is faster than InsertRecords.

-store-tags (type: bool, default: true)

Store tags if set true.

-tablet-size (type: int, default: 20)

When tablet-size is set more than 0, using insertTablets interface to load data to IoTDB; when tablet-size is set less or equals than 0, using insertRecords interface to load data to IoTDB.


tsbs_run_queries_iotdb Additional Flags

IoTDB related

-host (type: string, default: localhost)

Hostname of IoTDB instance.

-port (type: string, default: 6667)

Which port to connect to on the database host.

-user (type: string, default: root)

The username of user who connect to IoTDB.

-password (type: string, default: root)

The password for user connecting to IoTDB.

-use-groupby (type: bool, default: false)

Used to accelerate the query performance of single-groupby-1-1-1.