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 aa5920e Translate the mix.en.md in english. (#9289)
aa5920e is described below
commit aa5920e190908dceb769e3bdaf18b15f02f2f6c4
Author: MingHao Li <[email protected]>
AuthorDate: Wed Feb 3 15:54:00 2021 +0800
Translate the mix.en.md in english. (#9289)
---
.../configuration/yaml/mix.cn.md | 2 +-
.../configuration/yaml/mix.en.md | 64 +++++++++++++++++++++-
2 files changed, 64 insertions(+), 2 deletions(-)
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/yaml/mix.cn.md
b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/yaml/mix.cn.md
index 07ad96b..9d8447a 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/yaml/mix.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/yaml/mix.cn.md
@@ -29,7 +29,7 @@ rules:
shardingColumn: user_id
shardingAlgorithmName: t_user_inline
shardingAlgorithms:
- t_order_inline:
+ t_user_inline:
type: INLINE
props:
algorithm-expression: t_user_${user_id % 2}
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/yaml/mix.en.md
b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/yaml/mix.en.md
index 34ca4e5..0c73a5b 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/configuration/yaml/mix.en.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/configuration/yaml/mix.en.md
@@ -3,4 +3,66 @@ title = "Mixed Rules"
weight = 6
+++
-TODO
+
+The overlay between rule items in a mixed configuration is associated by the
data source name and the table name.
+
+If the previous rule is aggregation-oriented, the next rule needs to use the
aggregated logical data source name configured by the previous rule when
configuring the data source.
+Similarly, if the previous rule is table aggregation-oriented, the next rule
needs to use the aggregated logical table name configured by the previous rule
when configuring the table.
+
+## Configuration Item Explanation
+
+```yml
+dataSources: # Configure the real data source name.
+ primary_ds:
+ # ...Omit specific configuration.
+ replica_ds_0:
+ # ...Omit specific configuration.
+ replica_ds_0:
+ # ...Omit specific configuration.
+
+rules:
+ - !SHARDING # Configure data sharding rules.
+ tables:
+ t_user:
+ actualDataNodes: ds.t_user_${0..1} # Data source name 'ds' uses the
logical data source name of the read-write separation configuration.
+ tableStrategy:
+ standard:
+ shardingColumn: user_id
+ shardingAlgorithmName: t_user_inline
+ shardingAlgorithms:
+ t_user_inline:
+ type: INLINE
+ props:
+ algorithm-expression: t_user_${user_id % 2}
+
+ - !ENCRYPT # Configure data encryption rules.
+ tables:
+ t_user: # Table `t_user` is the name of the logical table that uses the
data sharding configuration.
+ columns:
+ pwd:
+ plainColumn: plain_pwd
+ cipherColumn: cipher_pwd
+ encryptorName: encryptor_aes
+ encryptors:
+ encryptor_aes:
+ type: aes
+ props:
+ aes-key-value: 123456abc
+
+ - !REPLICA_QUERY # Configure read-write separation rules.
+ dataSources:
+ ds:
+ name: ds # The logical data source name 'ds' for read-write separation
is used in data sharding.
+ primaryDataSourceName: primary_ds # Use the real data source name
'primary_ds'.
+ replicaDataSourceNames:
+ - replica_ds_0 # Use the real data source name 'replica_ds_0'.
+ - replica_ds_1 # Use the real data source name 'replica_ds_1'.
+ loadBalancerName: roundRobin
+ loadBalancers:
+ roundRobin:
+ type: ROUND_ROBIN
+
+props:
+ sql-show: true
+ query-with-cipher-column: true
+```