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 2021/11/03 06:00:38 UTC

[shardingsphere] branch master updated: Update scaling usage doc (#13421)

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

zhangliang 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 e333138  Update scaling usage doc (#13421)
e333138 is described below

commit e3331380fefc58287e34159999141abb1f496f30
Author: Hongsheng Zhong <sa...@126.com>
AuthorDate: Wed Nov 3 13:59:55 2021 +0800

    Update scaling usage doc (#13421)
    
    * Update scaling doc
    
    * Update doc of emit scaling job
---
 .../user-manual/shardingsphere-scaling/usage.cn.md | 38 ++++++++++++++++++++--
 .../user-manual/shardingsphere-scaling/usage.en.md | 38 ++++++++++++++++++++--
 2 files changed, 72 insertions(+), 4 deletions(-)

diff --git a/docs/document/content/user-manual/shardingsphere-scaling/usage.cn.md b/docs/document/content/user-manual/shardingsphere-scaling/usage.cn.md
index cacd27f..eae8aa6 100644
--- a/docs/document/content/user-manual/shardingsphere-scaling/usage.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-scaling/usage.cn.md
@@ -19,7 +19,25 @@ weight = 2
 
 **注意**:
 
-如果后端连接 MySQL 数据库,请下载 [mysql-connector-java-5.1.47.jar]( https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.47/mysql-connector-java-5.1.47.jar ),并将其放入 `${shardingsphere-proxy}/lib` 目录。
+如果后端连接以下数据库,请下载相应JDBC驱动jar包,并将其放入 `${shardingsphere-proxy}/lib` 目录。
+
+| 数据库                 | JDBC驱动                              | 参考                 |
+| --------------------- | ------------------------------------ | -------------------- |
+| MySQL                 | [mysql-connector-java-5.1.47.jar]( https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.47/mysql-connector-java-5.1.47.jar ) | [Connector/J Versions]( https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-versions.html ) |
+| openGauss             | [opengauss-jdbc-2.0.1-compatibility.jar]( https://repo1.maven.org/maven2/org/opengauss/opengauss-jdbc/2.0.1-compatibility/opengauss-jdbc-2.0.1-compatibility.jar ) | |
+
+功能支持情况:
+
+| 功能                   | MySQL         | PostgreSQL    | openGauss     |
+| --------------------- | ------------- | ------------- | ------------- |
+| 全量迁移               | 支持           | 支持           | 支持           |
+| 增量迁移               | 支持           | 支持           | 支持           |
+| 自动建表               | 支持           | 不支持         | 支持           |
+| 默认数据一致性校验算法   | 支持           | 不支持         | 不支持          |
+
+**注意**:
+
+还没开启`自动建表`的数据库需要手动创建分表。
 
 ### 权限要求
 
@@ -75,6 +93,8 @@ mysql> preview select count(1) from t_order;
 
 详情请参见[RDL#数据源资源](/cn/user-manual/shardingsphere-proxy/usage/distsql/syntax/rdl/rdl-resource/)。
 
+先在底层数据库系统创建需要的分库,下面的 `DistSQL` 需要用到。
+
 示例:
 ```sql
 ADD RESOURCE ds_2 (
@@ -90,7 +110,9 @@ ADD RESOURCE ds_2 (
 
 详情请参见[RDL#数据分片](/cn/user-manual/shardingsphere-proxy/usage/distsql/syntax/rdl/rdl-sharding-rule/)。
 
-示例:
+`SHARDING TABLE RULE`支持2种类型:`TableRule`和`AutoTableRule`。对于同一个逻辑表,不能混合使用这2种格式。
+
+`AutoTableRule`修改示例:
 ```sql
 ALTER SHARDING TABLE RULE t_order (
 RESOURCES(ds_2, ds_3, ds_4),
@@ -102,6 +124,18 @@ GENERATED_KEY(COLUMN=another_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123))
 
 比如说`RESOURCES`和`sharding-count`修改了会触发迁移。
 
+不完整的`TableRule`修改示例:
+```sql
+ALTER SHARDING TABLE RULE t_order (
+DATANODES("ds_${2..4}.t_order_${0..1}"),
+DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=user_id,SHARDING_ALGORITHM=database_inline),
+TABLE_STRATEGY(TYPE=standard,SHARDING_COLUMN=order_id,SHARDING_ALGORITHM=t_order_inline),
+GENERATED_KEY(COLUMN=order_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123)))
+);
+```
+
+**注意**:当前版本不支持通过修改`TableRule`触发迁移。
+
 #### 查询所有迁移任务
 
 详情请参见[RAL#弹性伸缩](/cn/user-manual/shardingsphere-proxy/usage/distsql/syntax/ral/ral/#%E5%BC%B9%E6%80%A7%E4%BC%B8%E7%BC%A9)。
diff --git a/docs/document/content/user-manual/shardingsphere-scaling/usage.en.md b/docs/document/content/user-manual/shardingsphere-scaling/usage.en.md
index b837516..f04a33f 100644
--- a/docs/document/content/user-manual/shardingsphere-scaling/usage.en.md
+++ b/docs/document/content/user-manual/shardingsphere-scaling/usage.en.md
@@ -19,7 +19,25 @@ The migration scene we support:
 
 **Attention**: 
 
-If the backend database is MySQL, please download [mysql-connector-java-5.1.47.jar](https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.47/mysql-connector-java-5.1.47.jar) and put it into `${shardingsphere-proxy}/lib directory`.
+If the backend database is in following table, please download JDBC driver jar and put it into `${shardingsphere-proxy}/lib` directory.
+
+| RDBMS                 | JDBC driver                          | Reference            |
+| --------------------- | ------------------------------------ | -------------------- |
+| MySQL                 | [mysql-connector-java-5.1.47.jar]( https://repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.47/mysql-connector-java-5.1.47.jar ) | [Connector/J Versions]( https://dev.mysql.com/doc/connector-j/5.1/en/connector-j-versions.html ) |
+| openGauss             | [opengauss-jdbc-2.0.1-compatibility.jar]( https://repo1.maven.org/maven2/org/opengauss/opengauss-jdbc/2.0.1-compatibility/opengauss-jdbc-2.0.1-compatibility.jar ) | |
+
+Supported features:
+
+| Feature                                  | MySQL         | PostgreSQL    | openGauss     |
+| ---------------------------------------- | ------------- | ------------- | ------------- |
+| Inventory migration                      | Supported     | Supported     | Supported     |
+| Incremental migration                    | Supported     | Supported     | Supported     |
+| Create table automatically               | Supported     | Unsupported   | Supported     |
+| Default data consistency check algorithm | Supported     | Unsupported   | Unsupported   |
+
+**Attention**:
+
+For RDBMS which `Create table automatically` feature is not supported, we need to create sharding tables manually.
 
 ### Privileges
 
@@ -75,6 +93,8 @@ mysql> preview select count(1) from t_order;
 
 Please refer to [RDL#Data Source](/en/user-manual/shardingsphere-proxy/usage/distsql/syntax/rdl/rdl-resource/) for more details.
 
+Create database on underlying RDBMS first, it will be used in following `DistSQL`.
+
 Example:
 ```sql
 ADD RESOURCE ds_2 (
@@ -90,7 +110,9 @@ ADD RESOURCE ds_2 (
 
 Please refer to [RDL#Sharding](/en/user-manual/shardingsphere-proxy/usage/distsql/syntax/rdl/rdl-sharding-rule/) for more details.
 
-Example:
+`SHARDING TABLE RULE` support two types: `TableRule` and `AutoTableRule`. For each logic table, we could not use mixture of these two types.
+
+Example of alter `AutoTableRule`:
 ```sql
 ALTER SHARDING TABLE RULE t_order (
 RESOURCES(ds_2, ds_3, ds_4),
@@ -102,6 +124,18 @@ GENERATED_KEY(COLUMN=another_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123))
 
 If `RESOURCES` and `sharding-count` is changed, then scaling job will be emitted.
 
+Uncompleted example of alter `TableRule`:
+```sql
+ALTER SHARDING TABLE RULE t_order (
+DATANODES("ds_${2..4}.t_order_${0..1}"),
+DATABASE_STRATEGY(TYPE=standard,SHARDING_COLUMN=user_id,SHARDING_ALGORITHM=database_inline),
+TABLE_STRATEGY(TYPE=standard,SHARDING_COLUMN=order_id,SHARDING_ALGORITHM=t_order_inline),
+GENERATED_KEY(COLUMN=order_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123)))
+);
+```
+
+**Attention**: We could not emit scaling job by altering `TableRule` in current version.
+
 #### List scaling jobs
 
 Please refer to [RAL#Scaling](/en/user-manual/shardingsphere-proxy/usage/distsql/syntax/ral/ral/#scaling) for more details.