You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@shardingsphere.apache.org by zh...@apache.org on 2022/01/18 03:42:26 UTC

[shardingsphere] branch master updated: Add document for sharding scaling rule (#14848)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 3ab713a  Add document for sharding scaling rule (#14848)
3ab713a is described below

commit 3ab713af894f7808525fab4287058daf1fff88cf
Author: Raigor <ra...@gmail.com>
AuthorDate: Tue Jan 18 11:41:32 2022 +0800

    Add document for sharding scaling rule (#14848)
---
 .../syntax/rdl/rule-definition/sharding.cn.md      | 90 +++++++++++++++++++--
 .../syntax/rdl/rule-definition/sharding.en.md      | 92 ++++++++++++++++++++--
 .../distsql/syntax/rql/rule-query/sharding.cn.md   | 46 ++++++++---
 .../distsql/syntax/rql/rule-query/sharding.en.md   | 46 ++++++++---
 4 files changed, 245 insertions(+), 29 deletions(-)

diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/sharding.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/sharding.cn.md
index cb0e550..9178878 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/sharding.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/sharding.cn.md
@@ -34,12 +34,12 @@ DROP SHARDING KEY GENERATOR keyGeneratorName [, keyGeneratorName] ...
 
 shardingTableRuleDefinition:
     shardingAutoTableRule | shardingTableRule
-   
+
 shardingAutoTableRule:
-    tableName(resources COMMA shardingColumn COMMA algorithmDefinition (COMMA keyGenerateDeclaration)?)
-    
+    tableName(resources, shardingColumn, algorithmDefinition [, keyGenerateDeclaration])
+
 shardingTableRule:
-    tableName(dataNodes (COMMA  databaseStrategy)? (COMMA tableStrategy)? (COMMA keyGenerateDeclaration)?)
+    tableName(dataNodes [, databaseStrategy] [, tableStrategy] [, keyGenerateDeclaration])
 
 resources:
     RESOURCES(resource [, resource] ...)
@@ -79,7 +79,7 @@ keyGenerateConstruction
 
 shardingStrategy:
     TYPE=strategyType, shardingColumn, shardingAlgorithm
-    
+
 shardingAlgorithm:
     existingAlgorithm | autoCreativeAlgorithm
 
@@ -139,6 +139,60 @@ DROP SHARDING BROADCAST TABLE RULES (tableName [, tableName] ...)
 ```
 - `ALTER` 会使用新的配置直接覆盖数据库内的广播表配置
 
+### Sharding Scaling Rule
+
+```sql
+CREATE SHARDING SCALING RULE scalingName [scalingDefinition]
+
+DROP SHARDING SCALING RULE scalingName
+
+ENABLE SHARDING SCALING RULE scalingName
+
+DISABLE SHARDING SCALING RULE scalingName
+
+scalingDefinition:
+    (minimumAutoDefinition | completeAutoDefinition | manualDefinition)
+
+minimumAutoDefinition:
+    completionDetector, dataConsistencyChecker
+
+completeAutoDefinition:
+    inputDefinition, outputDefinition, streamChannel, completionDetector, dataConsistencyChecker
+
+manualDefinition:
+    inputDefinition, outputDefinition, streamChannel
+
+inputDefinition:
+    INPUT (workerThread, batchSize, rateLimiter)
+
+outputDefinition:
+    INPUT (workerThread, batchSize, rateLimiter)
+
+completionDetector:
+    COMPLETION_DETECTOR (algorithmDefinition)
+
+dataConsistencyChecker:
+    DATA_CONSISTENCY_CHECKER (algorithmDefinition)
+
+rateLimiter:
+    RATE_LIMITER (algorithmDefinition)
+
+streamChannel:
+    STREAM_CHANNEL (algorithmDefinition)
+
+workerThread:
+    WORKER_THREAD=intValue
+
+batchSize:
+    BATCH_SIZE=intValue
+
+intValue:
+    INT
+```
+- `ENABLE` 用于设置启用哪个弹性伸缩配置
+- `DISABLE` 将禁用当前正在使用的配置
+- 创建 schema 中第一个弹性伸缩配置时,默认启用
+
 ## 示例
 
 ### Sharding Table Rule
@@ -241,3 +295,29 @@ DROP SHARDING BROADCAST TABLE RULES;
 
 DROP SHARDING BROADCAST TABLE RULES t_b;
 ```
+
+### Sharding Scaling Rule
+
+```sql
+CREATE SHARDING SCALING RULE sharding_scaling(
+INPUT(
+  WORKER_THREAD=40,
+  BATCH_SIZE=1000,
+  RATE_LIMITER(TYPE(NAME=QPS, PROPERTIES("qps"=50)))
+),
+OUTPUT(
+  WORKER_THREAD=40,
+  BATCH_SIZE=1000,
+  RATE_LIMITER(TYPE(NAME=TPS, PROPERTIES("tps"=2000)))
+),
+STREAM_CHANNEL(TYPE(NAME=MEMORY, PROPERTIES("block-queue-size"=10000))),
+COMPLETION_DETECTOR(TYPE(NAME=IDLE, PROPERTIES("incremental-task-idle-minute-threshold"=30))),
+DATA_CONSISTENCY_CHECKER(TYPE(NAME=DATA_MATCH, PROPERTIES("chunk-size"=1000)))
+);
+
+ENABLE SHARDING SCALING RULE sharding_scaling;
+
+DISABLE SHARDING SCALING RULE sharding_scaling;
+
+DROP SHARDING SCALING RULE sharding_scaling;
+```
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/sharding.en.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/sharding.en.md
index e7b6e5d..5207b56 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/sharding.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rdl/rule-definition/sharding.en.md
@@ -34,12 +34,12 @@ DROP SHARDING KEY GENERATOR keyGeneratorName [, keyGeneratorName] ...
 
 shardingTableRuleDefinition:
     shardingAutoTableRule | shardingTableRule
-   
+
 shardingAutoTableRule:
-    tableName(resources COMMA shardingColumn COMMA algorithmDefinition (COMMA keyGenerateDeclaration)?)
-    
+    tableName(resources, shardingColumn, algorithmDefinition [, keyGenerateDeclaration])
+
 shardingTableRule:
-    tableName(dataNodes (COMMA  databaseStrategy)? (COMMA tableStrategy)? (COMMA keyGenerateDeclaration)?)
+    tableName(dataNodes [, databaseStrategy] [, tableStrategy] [, keyGenerateDeclaration])
 
 resources:
     RESOURCES(resource [, resource] ...)
@@ -79,7 +79,7 @@ keyGenerateConstruction
 
 shardingStrategy:
     TYPE=strategyType, shardingColumn, shardingAlgorithm
-    
+
 shardingAlgorithm:
     existingAlgorithm | autoCreativeAlgorithm
 
@@ -99,7 +99,7 @@ algorithmProperties:
     algorithmProperty [, algorithmProperty] ...
 
 algorithmProperty:
-    key=value    
+    key=value   
 
 keyGeneratorDefinition: 
     keyGeneratorName (algorithmDefinition)
@@ -139,6 +139,60 @@ DROP SHARDING BROADCAST TABLE RULES
 ```
 - `ALTER` will overwrite the broadcast table configuration in the database with the new configuration
 
+### Sharding Scaling Rule
+
+```sql
+CREATE SHARDING SCALING RULE scalingName [scalingDefinition]
+
+DROP SHARDING SCALING RULE scalingName
+
+ENABLE SHARDING SCALING RULE scalingName
+
+DISABLE SHARDING SCALING RULE scalingName
+
+scalingDefinition:
+    (minimumAutoDefinition | completeAutoDefinition | manualDefinition)
+
+minimumAutoDefinition:
+    completionDetector, dataConsistencyChecker
+
+completeAutoDefinition:
+    inputDefinition, outputDefinition, streamChannel, completionDetector, dataConsistencyChecker
+
+manualDefinition:
+    inputDefinition, outputDefinition, streamChannel
+
+inputDefinition:
+    INPUT (workerThread, batchSize, rateLimiter)
+
+outputDefinition:
+    INPUT (workerThread, batchSize, rateLimiter)
+
+completionDetector:
+    COMPLETION_DETECTOR (algorithmDefinition)
+
+dataConsistencyChecker:
+    DATA_CONSISTENCY_CHECKER (algorithmDefinition)
+
+rateLimiter:
+    RATE_LIMITER (algorithmDefinition)
+
+streamChannel:
+    STREAM_CHANNEL (algorithmDefinition)
+
+workerThread:
+    WORKER_THREAD=intValue
+
+batchSize:
+    BATCH_SIZE=intValue
+
+intValue:
+    INT
+```
+- `ENABLE` is used to set which sharding scaling rule is enabled
+- `DISABLE` will disable the sharding scaling rule currently in use
+- Enabled by default when creating the first sharding scaling rule in a schema
+
 ## Example
 
 ### Sharding Table Rule
@@ -239,3 +293,29 @@ ALTER SHARDING BROADCAST TABLE RULES (t_b,t_a,t_3);
 
 DROP SHARDING BROADCAST TABLE RULES;
 ```
+
+### Sharding Scaling Rule
+
+```sql
+CREATE SHARDING SCALING RULE sharding_scaling(
+INPUT(
+  WORKER_THREAD=40,
+  BATCH_SIZE=1000,
+  RATE_LIMITER(TYPE(NAME=QPS, PROPERTIES("qps"=50)))
+),
+OUTPUT(
+  WORKER_THREAD=40,
+  BATCH_SIZE=1000,
+  RATE_LIMITER(TYPE(NAME=TPS, PROPERTIES("tps"=2000)))
+),
+STREAM_CHANNEL(TYPE(NAME=MEMORY, PROPERTIES("block-queue-size"=10000))),
+COMPLETION_DETECTOR(TYPE(NAME=IDLE, PROPERTIES("incremental-task-idle-minute-threshold"=30))),
+DATA_CONSISTENCY_CHECKER(TYPE(NAME=DATA_MATCH, PROPERTIES("chunk-size"=1000)))
+);
+
+ENABLE SHARDING SCALING RULE sharding_scaling;
+
+DISABLE SHARDING SCALING RULE sharding_scaling;
+
+DROP SHARDING SCALING RULE sharding_scaling;
+```
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/sharding.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/sharding.cn.md
index 682552f..bbc90fc 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/sharding.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/sharding.cn.md
@@ -40,6 +40,11 @@ SHOW SHARDING BINDING TABLE RULES [FROM schemaName]
 SHOW SHARDING BROADCAST TABLE RULES [FROM schemaName]
 ```
 
+### Sharding Scaling Rule
+```sql
+SHOW SHARDING SCALING RULES [FROM schemaName]
+```
+
 ## 返回值说明
 
 ### Sharding Table Rule
@@ -123,13 +128,24 @@ SHOW SHARDING BROADCAST TABLE RULES [FROM schemaName]
 | ------------------------- | -------- |
 | sharding_broadcast_tables | 广播表名称 |
 
+### Sharding Scaling Rule
+
+| 列                        | 说明              |
+|--------------------------|-------------------|
+| name                     | 弹性伸缩配置名称     |
+| input                    | 数据读取配置        |
+| output                   | 数据写入配置        |
+| stream_channel           | 数据通道配置        |
+| completion_detector      | 作业完成检测算法配置  |
+| data_consistency_checker | 数据一致性校验算法配置 |
+
 ## 示例
 
 ### Sharding Table Rule
 
 *SHOW SHARDING TABLE RULES*
 ```sql
-mysql> show sharding table rules;
+mysql> SHOW SHARDING TABLE RULES;
 +--------------+---------------------------------+-------------------+----------------------+------------------------+-------------------------------+----------------------------------------+-------------------+---------------------+----------------------------+---------------------------------------------------+-------------------+------------------+-------------------+
 | table        | actual_data_nodes               | actual_data_sources | database_strategy_type | database_sharding_column | database_sharding_algorithm_type | database_sharding_algorithm_props         | table_strategy_type | table_sharding_column | table_sharding_algorithm_type | table_sharding_algorithm_props                       | key_generate_column | key_generator_type | key_generator_props |
 +--------------+---------------------------------+-------------------+----------------------+------------------------+-------------------------------+----------------------------------------+-------------------+---------------------+----------------------------+---------------------------------------------------+-------------------+------------------+-------------------+
@@ -142,7 +158,7 @@ mysql> show sharding table rules;
 
 *SHOW SHARDING TABLE RULE tableName*
 ```sql
-mysql> show sharding table rule t_order;
+mysql> SHOW SHARDING TABLE RULE t_order;
 +---------+----------------------------+-------------------+----------------------+------------------------+-------------------------------+----------------------------------------+-------------------+---------------------+----------------------------+----------------------------------------------+-------------------+------------------+-------------------+
 | table   | actual_data_nodes          | actual_data_sources | database_strategy_type | database_sharding_column | database_sharding_algorithm_type | database_sharding_algorithm_props         | table_strategy_type | table_sharding_column | table_sharding_algorithm_type | table_sharding_algorithm_props                  | key_generate_column | key_generator_type | key_generator_props |
 +---------+----------------------------+-------------------+----------------------+------------------------+-------------------------------+----------------------------------------+-------------------+---------------------+----------------------------+----------------------------------------------+-------------------+------------------+-------------------+
@@ -153,7 +169,7 @@ mysql> show sharding table rule t_order;
 
 *SHOW SHARDING ALGORITHMS*
 ```sql
-mysql> show sharding algorithms;
+mysql> SHOW SHARDING ALGORITHMS;
 +-------------------------+--------+-----------------------------------------------------+
 | name                    | type   | props                                               |
 +-------------------------+--------+-----------------------------------------------------+
@@ -165,7 +181,7 @@ mysql> show sharding algorithms;
 
 *SHOW UNUSED SHARDING ALGORITHMS*
 ```sql
-mysql> show unused sharding algorithms;
+mysql> SHOW UNUSED SHARDING ALGORITHMS;
 +---------------+--------+-----------------------------------------------------+
 | name          | type   | props                                               |
 +---------------+--------+-----------------------------------------------------+
@@ -176,7 +192,7 @@ mysql> show unused sharding algorithms;
 
 *SHOW SHARDING KEY GENERATORS*
 ```sql
-mysql> show sharding key generators;
+mysql> SHOW SHARDING KEY GENERATORS;
 +------------------------+-----------+-----------------+
 | name                   | type      | props           |
 +------------------------+-----------+-----------------+
@@ -189,7 +205,7 @@ mysql> show sharding key generators;
 
 *SHOW UNUSED SHARDING KEY GENERATORS*
 ```sql
-mysql> show unused sharding key generators;
+mysql> SHOW UNUSED SHARDING KEY GENERATORS;
 +------------------------+-----------+-----------------+
 | name                   | type      | props           |
 +------------------------+-----------+-----------------+
@@ -214,7 +230,7 @@ mysql> SHOW DEFAULT SHARDING STRATEGY ;
 *SHOW SHARDING TABLE NODES*
 
 ```sql
-mysql> show sharding table nodes;
+mysql> SHOW SHARDING TABLE NODES;
 +---------+----------------------------------------------------------------+
 | name    | nodes                                                          |
 +---------+----------------------------------------------------------------+
@@ -226,7 +242,7 @@ mysql> show sharding table nodes;
 ### Sharding Binding Table Rule
 
 ```sql
-mysql> show sharding binding table rules from sharding_db;
+mysql> SHOW SHARDING BINDING TABLE RULES;
 +----------------------+
 | sharding_binding_tables |
 +----------------------+
@@ -239,7 +255,7 @@ mysql> show sharding binding table rules from sharding_db;
 ### Sharding Broadcast Table Rule
 
 ```sql
-mysql> show sharding broadcast table rules;
+mysql> SHOW SHARDING BROADCAST TABLE RULES;
 +------------------------+
 | sharding_broadcast_tables |
 +------------------------+
@@ -248,3 +264,15 @@ mysql> show sharding broadcast table rules;
 +------------------------+
 2 rows in set (0.00 sec)
 ```
+
+### Sharding Scaling Rule
+
+```sql
+mysql> SHOW SHARDING SCALING RULES;
++------------------+----------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+--------------------------------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+
+| name             | input                                                                                  | output                                                                                   | stream_channel                                         | completion_detector                                                     | data_consistency_checker                            |
++------------------+----------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+--------------------------------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+
+| sharding_scaling | {"workerThread":40,"batchSize":1000,"rateLimiter":{"type":"QPS","props":{"qps":"50"}}} | {"workerThread":40,"batchSize":1000,"rateLimiter":{"type":"TPS","props":{"tps":"2000"}}} | {"type":"MEMORY","props":{"block-queue-size":"10000"}} | {"type":"IDLE","props":{"incremental-task-idle-minute-threshold":"30"}} | {"type":"DATA_MATCH","props":{"chunk-size":"1000"}} |
++------------------+----------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+--------------------------------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+
+1 row in set (0.00 sec)
+```
\ No newline at end of file
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/sharding.en.md b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/sharding.en.md
index d7384b2..c2a47ed 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/sharding.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/distsql/syntax/rql/rule-query/sharding.en.md
@@ -40,6 +40,11 @@ SHOW SHARDING BINDING TABLE RULES [FROM schemaName]
 SHOW SHARDING BROADCAST TABLE RULES [FROM schemaName]
 ```
 
+### Sharding Scaling Rule
+```sql
+SHOW SHARDING SCALING RULES [FROM schemaName]
+```
+
 ## Return Value Description
 
 ### Sharding Table Rule
@@ -123,13 +128,24 @@ SHOW SHARDING BROADCAST TABLE RULES [FROM schemaName]
 | ------------------------- | ----------------------------- |
 | sharding_broadcast_tables | sharding Broadcast Table list |
 
+### Sharding Scaling Rule
+
+| Column                   | Description                            |
+|--------------------------|----------------------------------------|
+| name                     | name of sharding scaling rule          |
+| input                    | data read configuration                |
+| output                   | data write configuration               |
+| stream_channel           | algorithm of stream channel            |
+| completion_detector      | algorithm of completion detecting      |
+| data_consistency_checker | algorithm of data consistency checking |
+
 ## Example
 
 ### Sharding Table Rule
 
 *SHOW SHARDING TABLE RULES*
 ```sql
-mysql> show sharding table rules;
+mysql> SHOW SHARDING TABLE RULES;
 +--------------+---------------------------------+-------------------+----------------------+------------------------+-------------------------------+----------------------------------------+-------------------+---------------------+----------------------------+---------------------------------------------------+-------------------+------------------+-------------------+
 | table        | actual_data_nodes               | actual_data_sources | database_strategy_type | database_sharding_column | database_sharding_algorithm_type | database_sharding_algorithm_props         | table_strategy_type | table_sharding_column | table_sharding_algorithm_type | table_sharding_algorithm_props                       | key_generate_column | key_generator_type | key_generator_props |
 +--------------+---------------------------------+-------------------+----------------------+------------------------+-------------------------------+----------------------------------------+-------------------+---------------------+----------------------------+---------------------------------------------------+-------------------+------------------+-------------------+
@@ -142,7 +158,7 @@ mysql> show sharding table rules;
 
 *SHOW SHARDING TABLE RULE tableName*
 ```sql
-mysql> show sharding table rule t_order;
+mysql> SHOW SHARDING TABLE RULE t_order;
 +---------+----------------------------+-------------------+----------------------+------------------------+-------------------------------+----------------------------------------+-------------------+---------------------+----------------------------+----------------------------------------------+-------------------+------------------+-------------------+
 | table   | actual_data_nodes          | actual_data_sources | database_strategy_type | database_sharding_column | database_sharding_algorithm_type | database_sharding_algorithm_props         | table_strategy_type | table_sharding_column | table_sharding_algorithm_type | table_sharding_algorithm_props                  | key_generate_column | key_generator_type | key_generator_props |
 +---------+----------------------------+-------------------+----------------------+------------------------+-------------------------------+----------------------------------------+-------------------+---------------------+----------------------------+----------------------------------------------+-------------------+------------------+-------------------+
@@ -153,7 +169,7 @@ mysql> show sharding table rule t_order;
 
 *SHOW SHARDING ALGORITHMS*
 ```sql
-mysql> show sharding algorithms;
+mysql> SHOW SHARDING ALGORITHMS;
 +-------------------------+--------+-----------------------------------------------------+
 | name                    | type   | props                                               |
 +-------------------------+--------+-----------------------------------------------------+
@@ -165,7 +181,7 @@ mysql> show sharding algorithms;
 
 *SHOW UNUSED SHARDING ALGORITHMS*
 ```sql
-mysql> show unused sharding algorithms;
+mysql> SHOW UNUSED SHARDING ALGORITHMS;
 +---------------+--------+-----------------------------------------------------+
 | name          | type   | props                                               |
 +---------------+--------+-----------------------------------------------------+
@@ -176,7 +192,7 @@ mysql> show unused sharding algorithms;
 
 *SHOW SHARDING KEY GENERATORS*
 ```sql
-mysql> show sharding key generators;
+mysql> SHOW SHARDING KEY GENERATORS;
 +------------------------+-----------+-----------------+
 | name                   | type      | props           |
 +------------------------+-----------+-----------------+
@@ -189,7 +205,7 @@ mysql> show sharding key generators;
 
 *SHOW UNUSED SHARDING KEY GENERATORS*
 ```sql
-mysql> show unused sharding key generators;
+mysql> SHOW UNUSED SHARDING KEY GENERATORS;
 +------------------------+-----------+-----------------+
 | name                   | type      | props           |
 +------------------------+-----------+-----------------+
@@ -214,7 +230,7 @@ mysql> SHOW DEFAULT SHARDING STRATEGY ;
 *SHOW SHARDING TABLE NODES*
 
 ```sql
-mysql> show sharding table nodes;
+mysql> SHOW SHARDING TABLE NODES;
 +---------+----------------------------------------------------------------+
 | name    | nodes                                                          |
 +---------+----------------------------------------------------------------+
@@ -226,7 +242,7 @@ mysql> show sharding table nodes;
 ### Sharding Binding Table Rule
 
 ```sql
-mysql> show sharding binding table rules from sharding_db;
+mysql> SHOW SHARDING BINDING TABLE RULES;
 +----------------------+
 | sharding_binding_tables |
 +----------------------+
@@ -239,7 +255,7 @@ mysql> show sharding binding table rules from sharding_db;
 ### Sharding Broadcast Table Rule
 
 ```sql
-mysql> show sharding broadcast table rules;
+mysql> SHOW SHARDING BROADCAST TABLE RULES;
 +------------------------+
 | sharding_broadcast_tables |
 +------------------------+
@@ -248,3 +264,15 @@ mysql> show sharding broadcast table rules;
 +------------------------+
 2 rows in set (0.00 sec)
 ```
+
+### Sharding Scaling Rule
+
+```sql
+mysql> SHOW SHARDING SCALING RULES;
++------------------+----------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+--------------------------------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+
+| name             | input                                                                                  | output                                                                                   | stream_channel                                         | completion_detector                                                     | data_consistency_checker                            |
++------------------+----------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+--------------------------------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+
+| sharding_scaling | {"workerThread":40,"batchSize":1000,"rateLimiter":{"type":"QPS","props":{"qps":"50"}}} | {"workerThread":40,"batchSize":1000,"rateLimiter":{"type":"TPS","props":{"tps":"2000"}}} | {"type":"MEMORY","props":{"block-queue-size":"10000"}} | {"type":"IDLE","props":{"incremental-task-idle-minute-threshold":"30"}} | {"type":"DATA_MATCH","props":{"chunk-size":"1000"}} |
++------------------+----------------------------------------------------------------------------------------+------------------------------------------------------------------------------------------+--------------------------------------------------------+-------------------------------------------------------------------------+-----------------------------------------------------+
+1 row in set (0.00 sec)
+```