This is an automated email from the ASF dual-hosted git repository.

qiaojialin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/iotdb.git


The following commit(s) were added to refs/heads/master by this push:
     new 30983cf  Update virtual storage group docs (#4677)
30983cf is described below

commit 30983cf68255451db7aaad86ab47ec7998405965
Author: SilverNarcissus <[email protected]>
AuthorDate: Fri Dec 31 17:40:13 2021 +0800

    Update virtual storage group docs (#4677)
---
 docs/UserGuide/Appendix/Config-Manual.md           |  9 ++++
 .../UserGuide/Data-Modeling/VirtualStorageGroup.md | 55 ++++++++++++++++++++++
 docs/zh/UserGuide/Appendix/Config-Manual.md        |  9 ++++
 .../UserGuide/Data-Modeling/VirtualStorageGroup.md | 53 +++++++++++++++++++++
 4 files changed, 126 insertions(+)

diff --git a/docs/UserGuide/Appendix/Config-Manual.md 
b/docs/UserGuide/Appendix/Config-Manual.md
index e0f119d..b3aa37f 100644
--- a/docs/UserGuide/Appendix/Config-Manual.md
+++ b/docs/UserGuide/Appendix/Config-Manual.md
@@ -739,6 +739,15 @@ The permission definitions are in 
${IOTDB\_CONF}/conf/jmx.access.
 |Default| 604800 |
 |Effective|Only allowed to be modified in first start up|
 
+* virtual\_storage\_group\_num
+
+|Name| virtual\_storage\_group\_num |
+|:---:|:---|
+|Description| number of virtual storage groups per user-defined storage group, 
a virtual storage group is the unit of parallelism in memory as all ingestions 
in one virtual storage group are serialized, recommended value is [virtual 
storage group number] = [CPU core number] / [user-defined storage group number]|
+|Type| LONG |
+|Default| 1 |
+|Effective|Only allowed to be modified in first start up|
+
 * enable\_id\_table
 
 |Name| enable\_id\_table |
diff --git a/docs/UserGuide/Data-Modeling/VirtualStorageGroup.md 
b/docs/UserGuide/Data-Modeling/VirtualStorageGroup.md
new file mode 100644
index 0000000..8dca43f
--- /dev/null
+++ b/docs/UserGuide/Data-Modeling/VirtualStorageGroup.md
@@ -0,0 +1,55 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# Background
+
+The storage group is specified by the user display.
+Use the statement "SET STORAGE GROUP TO" to specify the storage group.
+Each storage group has a corresponding StorageGroupProcessor.
+
+To ensure eventually consistency, a insert lock (exclusive lock) is used to 
synchronize each insert request in each storage group.
+So the server side parallelism of data ingestion is equal to the number of 
storage group.
+
+# Problem
+
+From background, we can infer that the parallelism of data ingestion of IoTDB 
is max(num of client, server side parallelism), which equals to max(num of 
client, num of storage group)
+
+The concept of storage group usually is related to real world entity such as 
factory, location, country and so on.
+The number of storage groups may be small which makes the parallelism of data 
ingestion of IoTDB insufficient. We can't jump out of this dilemma even we 
start hundreds of client for ingestion.
+
+# Solution
+
+Our idea is to group devices into buckets and change the granularity of 
synchronization from storage group level to device buckets level.
+
+In detail, we use hash to group different devices into buckets called virtual 
storage group. 
+For example, one device called "root.sg.d"(assume it's storage group is 
"root.sg") is belonged to virtual storage group "root.sg.[hash("root.sg.d") mod 
num_of_virtual_storage_group]"
+
+# Usage
+
+To use virtual storage group, you can set this config below:
+
+```
+virtual_storage_group_num
+```
+
+Recommended value is [virtual storage group number] = [CPU core number] / 
[user-defined storage group number]
+
+For more information, you can refer to [this 
page](../Appendix/Config-Manual.md).
\ No newline at end of file
diff --git a/docs/zh/UserGuide/Appendix/Config-Manual.md 
b/docs/zh/UserGuide/Appendix/Config-Manual.md
index 78786f9..d0a0273 100644
--- a/docs/zh/UserGuide/Appendix/Config-Manual.md
+++ b/docs/zh/UserGuide/Appendix/Config-Manual.md
@@ -1485,6 +1485,15 @@
 |默认值| 604800 |
 |改后生效方式|仅允许在第一次启动服务前修改|
 
+* virtual\_storage\_group\_num
+
+|名字| virtual\_storage\_group\_num |
+|:---:|:---|
+|描述| 每一个用户定义存储组下虚拟存储组的数量, 虚拟存储组是内存中写入的并行单位,每一个虚拟存储组内的写入请求是串行的,推荐值为: [virtual 
storage group number] = [CPU core number] / [user-defined storage group number]|
+|类型| INT32 |
+|默认值| 1 |
+|改后生效方式|仅允许在第一次启动服务前修改|
+
 * enable\_id\_table
 
 |名字| enable\_id\_table |
diff --git a/docs/zh/UserGuide/Data-Modeling/VirtualStorageGroup.md 
b/docs/zh/UserGuide/Data-Modeling/VirtualStorageGroup.md
new file mode 100644
index 0000000..be73029
--- /dev/null
+++ b/docs/zh/UserGuide/Data-Modeling/VirtualStorageGroup.md
@@ -0,0 +1,53 @@
+<!--
+
+    Licensed to the Apache Software Foundation (ASF) under one
+    or more contributor license agreements.  See the NOTICE file
+    distributed with this work for additional information
+    regarding copyright ownership.  The ASF licenses this file
+    to you under the Apache License, Version 2.0 (the
+    "License"); you may not use this file except in compliance
+    with the License.  You may obtain a copy of the License at
+    
+        http://www.apache.org/licenses/LICENSE-2.0
+    
+    Unless required by applicable law or agreed to in writing,
+    software distributed under the License is distributed on an
+    "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+    KIND, either express or implied.  See the License for the
+    specific language governing permissions and limitations
+    under the License.
+
+-->
+
+# 背景
+
+存储组由用户显示指定,使用语句"SET STORAGE GROUP TO"来指定存储组,每一个存储组有一个对应的 StorageGroupProcessor
+
+为了确保最终一致性,每一个存储组有一个数据插入锁(排它锁)来同步每一次插入操作。
+所以服务端数据写入的并行度为存储组的数量。
+
+# 问题
+
+从背景中可知,IoTDB数据写入的并行度为 max(客户端数量,服务端数据写入的并行度),也就是max(客户端数量,存储组数量)
+
+在生产实践中,存储组的概念往往与特定真实世界实体相关(例如工厂,地点,国家等)。
+因此存储组的数量可能会比较小,这会导致IoTDB写入并行度不足。即使我们开再多的客户端写入线程,也无法走出这种困境。
+
+# 解决方案
+
+我们的方案是将一个存储组下的设备分为若干个设备组(称为虚拟存储组),将同步粒度从存储组级别改为虚拟存储组粒度。
+
+更具体的,我们使用哈希将设备分到不同的虚拟存储组下,例如:
+对于一个名为"root.sg.d"的设备(假设其存储组为"root.sg"),它属于的虚拟存储组为"root.sg.[hash("root.sg.d") 
mod num_of_virtual_storage_group]"
+
+# 使用方法
+
+通过改变如下配置来设置每一个存储组下虚拟存储组的数量:
+
+```
+virtual_storage_group_num
+```
+
+推荐值为[virtual storage group number] = [CPU core number] / [user-defined storage 
group number]
+
+参考[配置手册](../Appendix/Config-Manual.md)以获取更多信息。
\ No newline at end of file

Reply via email to