This is an automated email from the ASF dual-hosted git repository.
wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking-website.git
The following commit(s) were added to refs/heads/master by this push:
new 30a41b3 add new blog about IoTDB storage option (#370)
30a41b3 is described below
commit 30a41b31d09e7c653673779e5fa79271ec2c76e6
Author: 刘威 <[email protected]>
AuthorDate: Thu Dec 9 15:41:25 2021 +0800
add new blog about IoTDB storage option (#370)
---
.../index.md | 132 ++++++++---------
.../index.md | 163 +++++++++++++++++++++
.../iotdb-showcase-command.png | Bin 0 -> 56941 bytes
.../iotdb-showcase-screenshot.png | Bin 0 -> 108506 bytes
4 files changed, 229 insertions(+), 66 deletions(-)
diff --git a/content/blog/2021-11-23-design-of-iotdb-storage-option/index.md
b/content/blog/2021-11-23-design-of-iotdb-storage-option/index.md
index fe4e597..d346b56 100644
--- a/content/blog/2021-11-23-design-of-iotdb-storage-option/index.md
+++ b/content/blog/2021-11-23-design-of-iotdb-storage-option/index.md
@@ -9,7 +9,7 @@ tags:
- IoTDB
---
-This plugin is the outcome of [Apache IoTDB - Apache SkyWalking
Adapter](https://summer.iscas.ac.cn/#/org/prodetail/210070771) in [Summer 2021
of Open Source Promotion Plan](https://summer.iscas.ac.cn/#/homepage). The
design and development work is under the guidance of
[@jixuan1989](https://github.com/jixuan1989) from IoTDB and
[@wu-sheng](https://github.com/wu-sheng) from SkyWalking. Thanks for their
guidance and the help from community.
+This plugin is one of the outcomes of [Apache IoTDB - Apache SkyWalking
Adapter](https://summer.iscas.ac.cn/#/org/prodetail/210070771) in [Summer 2021
of Open Source Promotion Plan](https://summer.iscas.ac.cn/#/homepage). The
design and development work is under the guidance of
[@jixuan1989](https://github.com/jixuan1989) from IoTDB and
[@wu-sheng](https://github.com/wu-sheng) from SkyWalking. Thanks for their
guidance and the help from community.
## IoTDB Storage Plugin Setup
IoTDB is a time-series database from Apache, which is one of the storage
plugin options. If you want to use iotdb as SkyWalking backend storage, please
refer to the following configuration.
@@ -33,7 +33,7 @@ All connection related settings, including host, rpcPort,
username, and password
[Apache IoTDB](https://iotdb.apache.org/) (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. It is a time-series database donated by
Tsinghua University to Apache Foundation.
### The Data Model of IoTDB
-We can use the tree structure to understand the data model of iotdb. If
divided according to layers, from high to low is: `Storage Group` --
(`LayerName`) -- `Device` -- `Measurement`. From the top layer to a certain
layer below it is called a Path. The top layer is `Storage Group` (must start
with `root.`), the penultimate layer is `Device`, and the bottom layer is
`Measurement`. There can be many layers in the middle, and each layer is called
a `LayerName`. For more information, please [...]
+We can use the tree structure to understand the data model of iotdb. If
divided according to layers, from high to low is: `Storage Group` --
(`LayerName`) -- `Device` -- `Measurement`. From the top layer to a certain
layer below it is called a Path. The top layer is `Storage Group` (must start
with `root`), the penultimate layer is `Device`, and the bottom layer is
`Measurement`. There can be many layers in the middle, and each layer is called
a `LayerName`. For more information, please [...]
## The Design of IoTDB Storage Plugin
@@ -43,21 +43,21 @@ Each storage model of SkyWalking can be considered as a
Model, which contains mu
### Schema Design
Since each `LayerName` of IoTDB is stored in memory, it can be considered as
an index, and this feature can be fully utilized to improve IoTDB query
performance. The default storage group is `root.skywalking`, it will occupy the
first and the second layer of the path. The model name is stored at the next
layer of the storage group (the third layer of the path), such as
`root.skywalking.model_name`.
-SkyWalking has its own index requirement, but it isn't applicable to IoTDB.
Considering query frequency and referring to the implementation of the other
storage options, we choose `id`, `entity_id`, `node_type`, `service_id`,
`service_group`, `trace_id` as indexes and fix their order in the path. If we
don't fix their order, we cannot map their value to column, since we only store
their value in the path but don't store their column name. The other columns
are treated as Measurements.
+SkyWalking has its own index requirement, but it isn't applicable to IoTDB.
Considering query frequency and referring to the implementation of the other
storage options, we choose `id`, `entity_id`, `node_type`, `service_id`,
`service_group`, `trace_id` as indexes and fix their appearance order in the
path. The value of these indexed columns will occupy the last few layers of the
path. If we don't fix their order, we cannot map their value to column, since
we only store their value in th [...]
The mapping from SkyWalking data model to IoTDB data model is below.
-| SkyWalking | IoTDB |
-| -------------------- | -------------------------------------------- |
-| Database | Storage Group(1st and 2nd layer of the path) |
-| Model | LayerName(3rd layer of the path) |
-| Indexed Column | stored in memory through hard-code |
-| Indexed Column Value | LayerName(after 3rd layer of the path) |
-| Non-indexed Column | Measurement |
-| Non-indexed Value | the value of Measurement |
+| SkyWalking | IoTDB |
+| -------------------- | --------------------------------------------- |
+| Database | Storage Group (1st and 2nd layer of the path) |
+| Model | LayerName (3rd layer of the path) |
+| Indexed Column | stored in memory through hard-code |
+| Indexed Column Value | LayerName (after 3rd layer of the path) |
+| Non-indexed Column | Measurement |
+| Non-indexed Value | the value of Measurement |
#### For general example
-There are model1('column11', column12), model2('column21', 'column22',
column23), model3(column31). Single quotation mark indicates that the column
requires to be indexed. In this example, `modelx_name` refers to the name of
modelx, `columnx_name` refers to the name of columnx and `columnx_value` refers
to the value of columnx.
+There are model1(<u>column11</u>, column12), model2(<u>column21</u>,
<u>column22</u>, column23), model3(column31). Underline indicates that the
column requires to be indexed. In this example, `modelx_name` refers to the
name of modelx, `columnx_name` refers to the name of columnx and
`columnx_value` refers to the value of columnx.
Before these 3 model storage schema, here are some points we need to know.
- In order to avoid the value of indexed column contains dot(`.`), all of them
should be wrapped in double quotation mark since IoTDB use dot(`.`) as the
separator in the path.
@@ -89,97 +89,97 @@ Before 5 typical examples, here are some points we need to
know.
- The indexed columns and their order: `id`, `entity_id`, `node_type`,
`service_id`, `service_group`, `trace_id`. Other columns are treated as non
indexed and stored as Measurement.
- The storage entity extends Metrics or Record contains a column
`time_bucket`. The `time_bucket` column in SkyWalking Model can be converted to
the `timestamp` of IoTDB when inserting data. We don't need to store
`time_bucket` separately. In the next examples, we won't list `time_bucket`
anymore.
- The `Time` in query result corresponds to the `timestamp` in insert SQL and
API.
-
-1) Metadata: service_traffic
-service_traffic entity has 4 columns: 'id', name, 'node_type',
'service_group'.
-When service_traffic entity includes a row with timestamp 1637494020000, the
row should be as following:
-(**Notice**: the value of service_group is null.)
+1. Metadata: service_traffic
+ service_traffic entity has 4 columns: <u>id</u>, name, <u>node_type</u>,
<u>service_group</u>.
+ When service_traffic entity includes a row with timestamp 1637494020000,
the row should be as following:
+ (**Notice**: the value of service_group is null.)
+
| id | name | node_type |
service_group |
| ------------------------------ | -------------------- | --------- |
------------- |
| ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1 | e2e-service-provider | 0 |
|
-
-And the row stored in IoTDB should be as following:
-(Query SQL: `select from root.skywalking.service_traffic align by device`)
-
+
+ And the row stored in IoTDB should be as following:
+ (Query SQL: `select from root.skywalking.service_traffic align by device`)
+
| Time | Device
| name |
| ------------- |
--------------------------------------------------------------------------- |
-------------------- |
| 1637494020000 |
root.skywalking.service_traffic."ZTJlLXNlcnZpY2UtcHJvdmlkZXI=.1"."0"."null" |
e2e-service-provider |
+
+ The value of id, node_type and service_group are stored in the path in the
specified order.
+ **Notice**: If those index value is null, it will be transformed to a
string "null".
-The value of id, node_type and service_group are stored in the path in the
specified order.
-**Notice**: If those index value is null, it will be transformed to a string
"null".
-
-2) Metrics: service_cpm
-service_cpm entity has 4 columns: 'id', 'service_id', total, value.
-When service_cpm entity includes a row with timestamp 1637494020000, the row
should be as following:
+2. Metrics: service_cpm
+ service_cpm entity has 4 columns: <u>id</u>, <u>service_id</u>, total,
value.
+ When service_cpm entity includes a row with timestamp 1637494020000, the
row should be as following:
| id | service_id
| total | value |
| ------------------------------------------- | ------------------------------
| ----- | ----- |
| 202111211127_ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1 | ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1
| 4 | 4 |
-
-And the row stored in IoTDB should be as following:
-(Query SQL: `select from root.skywalking.service_cpm align by device`)
+
+ And the row stored in IoTDB should be as following:
+ (Query SQL: `select from root.skywalking.service_cpm align by device`)
-| Time | Device
| total | value |
+| Time | Device
| total | value |
| ------------- |
----------------------------------------------------------------------------------------------------------
| ----- | ----- |
| 1637494020000 |
root.skywalking.service_cpm."202111211127_ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1"."ZTJlLXNlcnZpY2UtY29uc3VtZXI=.1"
| 4 | 4 |
-
-The value of id and service_id are stored in the path in the specified order.
+
+ The value of id and service_id are stored in the path in the specified
order.
+
+3. Trace segment: segment
+ segment entity has 10 columns at least: <u>id</u>, segment_id,
<u>trace_id</u>, <u>service_id</u>, service_instance_id, endpoint_id,
start_time, latency, is_error, data_binary. In addition, it could have variable
number of tags.
+ When segment entity includes 2 rows with timestamp 1637494106000 and
1637494134000, these rows should be as following. The `db.type` and
`db.instance` are two tags. The first data has two tags, and the second data
doesn't have tag.
-3) Trace segment: segment
-segment entity has 10 columns at least: 'id', segment_id, 'trace_id',
'service_id', service_instance_id, endpoint_id, start_time, latency, is_error,
data_binary. In addition, it could have variable number of tags.
-When segment entity includes 2 rows with timestamp 1637494106000 and
1637494134000, these rows should be as following. The `db.type` and
`db.instance` are two tags. The first data has two tags, and the second data
doesn't have tag.
-
| id | segment_id | trace_id | service_id | service_instance_id |
endpoint_id | start_time | latency | is_error | data_binary | db.type |
db.instance |
| ---- | ------------ | ---------- | ------------ | --------------------- |
------------- | ------------- | ------- | -------- | ------------- | ------- |
----------- |
| id_1 | segment_id_1 | trace_id_1 | service_id_1 | service_instance_id_1 |
endpoint_id_1 | 1637494106515 | 1425 | 0 | data_binary_1 | sql |
testdb |
| id_2 | segment_id_2 | trace_id_2 | service_id_2 | service_instance_id_2 |
endpoint_id_2 | 2637494106765 | 1254 | 0 | data_binary_2 | |
|
-
-And these row stored in IoTDB should be as following:
-(Query SQL: `select from root.skywalking.segment align by device`)
-
+
+ And these row stored in IoTDB should be as following:
+ (Query SQL: `select from root.skywalking.segment align by device`)
+
| Time | Device |
start_time | data_binary | latency | endpoint_id | is_error |
service_instance_id | segment_id | "db.type" | "db.instance" |
| ------------- | ---------------------------------------------------------- |
------------- | ------------- | ------- | ------------- | -------- |
--------------------- | ------------ | --------- | ------------- |
| 1637494106000 | root.skywalking.segment."id_1"."service_id_1"."trace_id_1" |
1637494106515 | data_binary_1 | 1425 | endpoint_id_1 | 0 |
service_instance_id_1 | segment_id_1 | sql | testdb |
| 1637494106000 | root.skywalking.segment."id_2"."service_id_2"."trace_id_2" |
1637494106765 | data_binary_2 | 1254 | endpoint_id_2 | 0 |
service_instance_id_2 | segment_id_2 | null | null |
-
-The value of id, service_id and trace_id are stored in the path in the
specified order.
-**Notice**: If the measurement contains dot(`.`), it will be wrapped in double
quotation mark since IoTDB doesn't allow it. In order to align, IoTDB will
append null value for those data without tag in some models.
-
-4) Log
-log entity has 12 columns at least: 'id', unique_id, 'service_id',
service_instance_id, endpoint_id, 'trace_id', trace_segment_id, span_id,
content_type, content, tags_raw_data, timestamp. In addition, it could have
variable number of tags.
-When log entity includes a row with timestamp 1637494052000, the row should be
as following and the level is a tag.
-
+
+ The value of id, service_id and trace_id are stored in the path in the
specified order.
+ **Notice**: If the measurement contains dot(`.`), it will be wrapped in
double quotation mark since IoTDB doesn't allow it. In order to align, IoTDB
will append null value for those data without tag in some models.
+
+4. Log
+ log entity has 12 columns at least: <u>id</u>, unique_id,
<u>service_id</u>, service_instance_id, endpoint_id, <u>trace_id</u>,
trace_segment_id, span_id, content_type, content, tags_raw_data, timestamp. In
addition, it could have variable number of tags.
+ When log entity includes a row with timestamp 1637494052000, the row should
be as following and the level is a tag.
+
| id | unique_id | service_id | service_instance_id | endpoint_id |
trace_id | trace_segment_id | span_id | content_type | content |
tags_raw_data | timestamp | level |
| ---- | ----------- | ------------ | --------------------- | ------------- |
---------- | ------------------ | ------- | ------------ | --------- |
--------------- | ------------- | ----- |
| id_1 | unique_id_1 | service_id_1 | service_instance_id_1 | endpoint_id_1 |
trace_id_1 | trace_segment_id_1 | 0 | 1 | content_1 |
tags_raw_data_1 | 1637494052118 | INFO |
-
-And the row stored in IoTDB should be as following:
-(Query SQL: `select from root.skywalking.log align by device`)
+
+ And the row stored in IoTDB should be as following:
+ (Query SQL: `select from root.skywalking.log align by device`)
| Time | Device |
unique_id | content_type | span_id | tags_raw_data | "timestamp" | level
| service_instance_id | content | trace_segment_id |
| ------------- | -------------------------------------------------- |
----------- | ------------ | ------- | --------------- | ------------- | -----
| --------------------- | --------- | ------------------ |
| 1637494052000 | root.skywalking."id_1"."service_id_1"."trace_id_1" |
unique_id_1 | 1 | 0 | tags_raw_data_1 | 1637494052118 | INFO
| service_instance_id_1 | content_1 | trace_segment_id_1 |
-
-The value of id, service_id and trace_id are stored in the path in the
specified order.
-**Notice**: If the measurement named timestamp, it will be wrapped in double
quotation mark since IoTDB doesn't allow it.
-
-5) Profiling snapshots: profile_task_segment_snapshot
-profile_task_segment_snapshot has 6 columns: 'id', task_id, segment_id,
dump_time, sequence, stack_binary.
-When profile_task_segment_snapshot includes a row with timestamp
1637494131000, the row should be as following.
-
+
+ The value of id, service_id and trace_id are stored in the path in the
specified order.
+ **Notice**: If the measurement named timestamp, it will be wrapped in
double quotation mark since IoTDB doesn't allow it.
+
+5. Profiling snapshots: profile_task_segment_snapshot
+ profile_task_segment_snapshot entity has 6 columns: <u>id</u>, task_id,
segment_id, dump_time, sequence, stack_binary.
+ When profile_task_segment_snapshot includes a row with timestamp
1637494131000, the row should be as following.
+
| id | task_id | segment_id | dump_time | sequence | stack_binary |
| ---- | --------- | ------------ | ------------- | -------- | -------------- |
| id_1 | task_id_1 | segment_id_1 | 1637494131153 | 0 | stack_binary_1 |
-
-And the row stored in IoTDB should be as following:
-(Query SQL: `select from root.skywalking.profile_task_segment_snapshot align
by device`)
-
+
+ And the row stored in IoTDB should be as following:
+ (Query SQL: `select from root.skywalking.profile_task_segment_snapshot
align by device`)
+
| Time | Device |
sequence | dump_time | stack_binary | task_id | segment_id |
| ------------- | ---------------------------------------------------- |
-------- | ------------- | -------------- | --------- | ------------ |
| 1637494131000 | root.skywalking.profile_task_segment_snapshot."id_1" | 0
| 1637494131153 | stack_binary_1 | task_id_1 | segment_id_1 |
-
-The value of id is stored in the path in the specified order.
+
+ The value of id is stored in the path in the specified order.
### Query
In this design, part of the data is stored in memory through `LayerName`, so
data from the same Model is spread across multiple `devices`. Queries often
need to cross multiple `devices`. But in this aspect, IoTDB's support is not
perfect in cross-device aggregation query, sort query and pagination query. In
some cases, we have to use a **violence method** that query all data meets the
condition and then aggregate, sort or paginate them. So it might not be
efficient. For detailed descript [...]
diff --git
a/content/blog/2021-12-08-application-guide-of-iotdb-storage-option/index.md
b/content/blog/2021-12-08-application-guide-of-iotdb-storage-option/index.md
new file mode 100644
index 0000000..cb58f19
--- /dev/null
+++ b/content/blog/2021-12-08-application-guide-of-iotdb-storage-option/index.md
@@ -0,0 +1,163 @@
+---
+title: "The Application Guide of Apache IoTDB Storage Option"
+date: "2021-12-08"
+author: "[Wei Liu](https://github.com/LIU-WEI-git), School of Computer
Science, NPU, China"
+description: "This guide will tell you how to use SkyWalking Showcase to run
demo applications or start manually step by step. In addition, it introduces
some methods about visiting IoTDB server and gives some query SQLs as example."
+
+tags:
+- Storage
+- IoTDB
+---
+
+This document is one of the outcomes of [Apache IoTDB - Apache SkyWalking
Adapter](https://summer.iscas.ac.cn/#/org/prodetail/210070771) in [Summer 2021
of Open Source Promotion Plan](https://summer.iscas.ac.cn/#/homepage). The
design and development work is under the guidance of
[@jixuan1989](https://github.com/jixuan1989) from IoTDB and
[@wu-sheng](https://github.com/wu-sheng) from SkyWalking. Thanks for their
guidance and the help from community.
+
+## Start with SkyWalking Showcase
+Before using SkyWalking Showcase to quick start with IoTDB, please ensure your
have `make` installed and Docker daemon running.
+
+Please run the command below.
+```shell
+git clone https://github.com/LIU-WEI-git/skywalking-showcase.git
+cd skywalking-showcase
+make deploy.docker FEATURE_FLAGS=single-node.iotdb,agent
+```
+
+The former variable `single-node.iotdb` will deploy only one single node of
SkyWalking OAP-v8.9.0, and SkyWalking RocketBot UI-v8.9.0, IoTDB-v0.12.3 as
storage. The latter variable `agent` will deploy micro-services with SkyWalking
agent enabled, which include agents for Java, NodeJS server, browser, Python.
+
+
+
+These shell command maybe take a long while. After pulling and running docker
image, please visit http://localhost:9999/. Then you will see the SkyWalking UI
and data from OAP backend.
+
+
+
+If you want to use more functions of SkyWalking Showcase, please visit its
[official
document](https://skywalking.apache.org/docs/skywalking-showcase/latest/readme/)
and clone [official repository](https://github.com/apache/skywalking-showcase).
+
+## Start Manually
+If you want to download and run IoTDB and SkyWalking manually, here is the
guidance.
+
+### Install and Run IoTDB
+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. It is a time-series database storage option for SkyWalking now.
+Please ensure your **IoTDB server version >=
[0.12.3](https://github.com/apache/iotdb/releases/tag/v0.12.3)** and a single
node version is sufficient. For more installation details, please see official
document: [IoTDB Quick
Start](https://iotdb.apache.org/UserGuide/V0.12.x/QuickStart/QuickStart.html)
and [IoTDB Download Page](https://iotdb.apache.org/Download/). You could
download it from [Docker Hub](https://hub.docker.com/r/apache/iotdb) as well.
+
+There is some connection tools for IoTDB
+- [Command Line
Interface(CLI)](https://iotdb.apache.org/UserGuide/V0.12.x/CLI/Command-Line-Interface.html)
+ If iotdb-cli connects successfully, you will see
+```
+ _____ _________ ______ ______
+|_ _| | _ _ ||_ _ `.|_ _ \
+ | | .--.|_/ | | \_| | | `. \ | |_) |
+ | | / .'`\ \ | | | | | | | __'.
+ _| |_| \__. | _| |_ _| |_.' /_| |__) |
+|_____|'.__.' |_____| |______.'|_______/ version x.x.x
+
+
+IoTDB> login successfully
+IoTDB>
+```
+-
[IoTDB-Grafana](https://iotdb.apache.org/UserGuide/V0.12.x/Ecosystem%20Integration/Grafana.html)
+ IoTDB-Grafana is a connector which we developed to show time series data in
IoTDB by reading data from IoTDB and sends to [Grafana](https://grafana.com/).
+

+-
[Zeppelin-IoTDB](https://iotdb.apache.org/UserGuide/V0.12.x/Ecosystem%20Integration/Zeppelin-IoTDB.html)
+ You could enable Zeppelin to operate IoTDB via SQL.
+

+
+For more ecosystem integration, please visit official documents.
+
+We will use iotdb-cli in the next examples.
+
+### Run SkyWalking OAP Server
+There are some SkyWalking official documents which will help you start. Please
ensure your **SkyWalking version >=
[8.9.0](https://github.com/apache/skywalking/releases/tag/v8.9.0)**. We
recommend you download SkyWalking OAP distributions from its official download
page or pull docker images.
+- [SkyWalking Download Page](https://skywalking.apache.org/downloads/)
+- [SkyWalking Backend
Setup](https://skywalking.apache.org/docs/main/latest/en/setup/backend/backend-setup/)
+- [SkyWalking UI
Setup](https://skywalking.apache.org/docs/main/latest/en/setup/backend/ui-setup/)
+
+Before starting SkyWalking backend, please edit `/config/application.yml`, set
`storage.selector: ${SW_STORAGE:iotdb}` or set environment variable
`SW_STORAGE=iotdb`. All config options about IoTDB is following, please edit it
or not according to your local environment:
+```yaml
+storage:
+ selector: ${SW_STORAGE:iotdb}
+ iotdb:
+ host: ${SW_STORAGE_IOTDB_HOST:127.0.0.1}
+ rpcPort: ${SW_STORAGE_IOTDB_RPC_PORT:6667}
+ username: ${SW_STORAGE_IOTDB_USERNAME:root}
+ password: ${SW_STORAGE_IOTDB_PASSWORD:root}
+ storageGroup: ${SW_STORAGE_IOTDB_STORAGE_GROUP:root.skywalking}
+ sessionPoolSize: ${SW_STORAGE_IOTDB_SESSIONPOOL_SIZE:16}
+ fetchTaskLogMaxSize: ${SW_STORAGE_IOTDB_FETCH_TASK_LOG_MAX_SIZE:1000} #
the max number of fetch task log in a request
+```
+
+## Visit IoTDB Server and Query SkyWalking Data
+There are some official document about data model and IoTDB-SQL language:
+- [Data Model and
Terminology](https://iotdb.apache.org/UserGuide/V0.12.x/Data-Concept/Data-Model-and-Terminology.html)
+- [DDL (Data Definition
Language)](https://iotdb.apache.org/UserGuide/V0.12.x/IoTDB-SQL-Language/DDL-Data-Definition-Language.html)
+- [DML (Data Manipulation
Language)](https://iotdb.apache.org/UserGuide/V0.12.x/IoTDB-SQL-Language/DML-Data-Manipulation-Language.html)
+- [Maintenance
Command](https://iotdb.apache.org/UserGuide/V0.12.x/IoTDB-SQL-Language/Maintenance-Command.html)
+
+### Example Model and Insert SQL
+Before giving any example, we set time display type as long (CLI: `set
time_display_type=long`).
+
+In our design, we choose `id`, `entity_id`, `node_type`, `service_id`,
`service_group`, `trace_id` as indexes and fix their appearance order. The
value of these indexed fields store in the path with double quotation mark
wrapping, just like `"value"`.
+
+There is a model named `service_traffic` with fields `id`, `time_bucket`,
`name`, `node_type`, `service_group`. In order to see its data, we could use a
query SQL: `select * from root.skywalking.service_traffic align by device`.
`root.skywalking` is the default storage group and `align by device` could
return a more friendly result. The query result is following:
+
+| Time | Device
| name |
+| ------------- |
--------------------------------------------------------------------------- |
---------------------- |
+| 1637919540000 |
root.skywalking.service_traffic."YXBwbGljYXRpb24tZGVtbw==.1"."0"."" |
application-demo |
+| 1637919600000 |
root.skywalking.service_traffic."YXBwbGljYXRpb24tZGVtby1teXNxbA==.1"."0"."" |
application-demo-mysql |
+
+Another example model is `service_cpm` which has fields `id`, `service_id`,
`total`, `value`. Query its data with `select * from
root.skywalking.service_cpm align by device`. The result is following:
+
+| Time | Device
| total | value |
+| ------------- |
------------------------------------------------------------------------------------------------------------------
| ----- | ----- |
+| 1637919540000 |
root.skywalking.service_cpm."202111261739_YXBwbGljYXRpb24tZGVtbw==.1"."YXBwbGljYXRpb24tZGVtbw==.1"
| 2 | 2 |
+| 1637919600000 |
root.skywalking.service_cpm."202111261740_YXBwbGljYXRpb24tZGVtby1teXNxbA==.1"."YXBwbGljYXRpb24tZGVtby1teXNxbA==.1"
| 1 | 1 |
+| 1637917200000 |
root.skywalking.service_cpm."2021112617_YXBwbGljYXRpb24tZGVtbw==.1"."YXBwbGljYXRpb24tZGVtbw==.1"
| 2 | 0 |
+
+For the first data of `service_traffic`, the mapping between fields and values
is following. Notice, all `time_bucket` are converted to `timestamp`(also named
`time` in IoTDB) and the value of all indexed fields are stored in the Device
path.
+
+| Field | Value |
+| -------------------------------- | -------------------------- |
+| id(indexed) | YXBwbGljYXRpb24tZGVtbw==.1 |
+| time(converted from time_bucket) | 1637919540000 |
+| name | application-demo |
+| node_type(indexed) | 0 |
+| service_group(indexed) | (empty string) |
+
+You could use the SQL below to insert example data.
+```sql
+create storage group root.skywalking
+insert into
root.skywalking.service_traffic."YXBwbGljYXRpb24tZGVtbw==.1"."0".""(timestamp,
name) values(1637919540000, "application-demo")
+insert into
root.skywalking.service_traffic."YXBwbGljYXRpb24tZGVtby1teXNxbA==.1"."0".""(timestamp,
name) values(1637919600000, "application-demo-mysql")
+insert into
root.skywalking.service_cpm."202111261739_YXBwbGljYXRpb24tZGVtbw==.1"."YXBwbGljYXRpb24tZGVtbw==.1"(timestamp,
total, value) values(1637919540000, 2, 2)
+insert into
root.skywalking.service_cpm."202111261740_YXBwbGljYXRpb24tZGVtby1teXNxbA==.1"."YXBwbGljYXRpb24tZGVtby1teXNxbA==.1"(timestamp,
total, value) values(1637919600000, 1, 1)
+insert into
root.skywalking.service_cpm."2021112617_YXBwbGljYXRpb24tZGVtbw==.1"."YXBwbGljYXRpb24tZGVtbw==.1"(timestamp,
total, value) values(1637917200000, 2, 0)
+```
+
+### Query SQL
+Now, let's show some query examples.
+1. Filter Query
+ - If you want to query `name` field of `service_traffic`, the query SQL is
`select name from root.skywalking.service_traffic align by device`.
+ - If you want to query `service_traffic` with `id =
YXBwbGljYXRpb24tZGVtbw==.1`, the query SQL is `select * from
root.skywalking.service_traffic."YXBwbGljYXRpb24tZGVtbw==.1" align by device`.
+ - If you want to query `service_traffic` with `name = application-demo`,
the query SQL is `select * from root.skywalking.service_traffic where name =
"application-demo" align by device`.
+ - Combining the above three, the query SQL is `select name from
root.skywalking.service_traffic."YXBwbGljYXRpb24tZGVtbw==.1" where name =
"application-demo" align by device`.
+
+2. Fuzzy Query
+ - If you want to query `service_traffic` with `name` contains
`application`, the query SQL is `select * from
root.skywalking.service_traffic.*.*.* where name like '%application%' align by
device`.
+
+3. Aggregate Query
+ IoTDB only supports `group by time` and `group by level`. The former please
refer to [Down-Frequency Aggregate
Query](https://iotdb.apache.org/UserGuide/V0.12.x/IoTDB-SQL-Language/DML-Data-Manipulation-Language.html#down-frequency-aggregate-query)
and the latter please refer to [Aggregation By
Level](https://iotdb.apache.org/UserGuide/V0.12.x/IoTDB-SQL-Language/DML-Data-Manipulation-Language.html#aggregation-by-level).
Here is an example about `group by level`: `select sum(total) from [...]
+
+4. Sort Query
+ IoTDB only supports `order by time`, but we could use its [select
function](https://iotdb.apache.org/UserGuide/V0.12.x/IoTDB-SQL-Language/DML-Data-Manipulation-Language.html#selector-functions)
which contains `top_k` and `bottom_k` to get top/bottom k data. For example,
`select top_k(total, "k"="3") from root.skywalking.service_cpm.*.*`. We don't
recommend using this to query SkyWalking backend data since its result is not
friendly. You could refer to the [Discussion #3888](https://gi [...]
+
+5. Pagination Query
+ We could use `limit` and `offset` to paginate the query result. Please
refer to [Row and Column Control over Query
Results](https://iotdb.apache.org/UserGuide/V0.12.x/IoTDB-SQL-Language/DML-Data-Manipulation-Language.html#row-and-column-control-over-query-results).
+
+6. Delete
+ - Delete storage group:
+ - `delete storage group root.skywalking`
+ - Delete timeseries:
+ - `delete timeseries root.skywalking.service_cpm.*.*.total`
+ - `delete timeseries
root.skywalking.service_cpm."202111261739_YXBwbGljYXRpb24tZGVtbw==.1"."YXBwbGljYXRpb24tZGVtbw==.1".total`
+ - Delete data:
+ - `delete from root.skywalking.service_traffic`
+ - `delete from root.skywalking.service_traffic where time < 1637919540000`
+
diff --git
a/content/blog/2021-12-08-application-guide-of-iotdb-storage-option/iotdb-showcase-command.png
b/content/blog/2021-12-08-application-guide-of-iotdb-storage-option/iotdb-showcase-command.png
new file mode 100644
index 0000000..83e70ec
Binary files /dev/null and
b/content/blog/2021-12-08-application-guide-of-iotdb-storage-option/iotdb-showcase-command.png
differ
diff --git
a/content/blog/2021-12-08-application-guide-of-iotdb-storage-option/iotdb-showcase-screenshot.png
b/content/blog/2021-12-08-application-guide-of-iotdb-storage-option/iotdb-showcase-screenshot.png
new file mode 100644
index 0000000..947e30f
Binary files /dev/null and
b/content/blog/2021-12-08-application-guide-of-iotdb-storage-option/iotdb-showcase-screenshot.png
differ