Back to Shardingsphere

Algorithm.Cn

docs/document/content/user-manual/shardingsphere-jdbc/yaml-config/algorithm.cn.md

5.5.31.9 KB
Original Source

+++ title = "算法配置" weight = 4 +++

分片算法

yaml
shardingAlgorithms:
  # algorithmName 由用户指定,需要和分片策略中的 shardingAlgorithmName 属性一致
  <algorithmName>:
    # type 和 props,请参考分片内置算法:https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/builtin-algorithm/sharding/
    type: xxx
    props:
      xxx: xxx

加密算法

yaml
encryptors:
  # encryptorName 由用户指定,需要和加密规则中的 encryptorName 属性一致
  <encryptorName>:
    # type 和 props,请参考加密内置算法:https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/builtin-algorithm/encrypt/
    type: xxx
    props:
      xxx: xxx

读写分离负载均衡算法

yaml
loadBalancers:
  # loadBalancerName 由用户指定,需要和读写分离规则中的 loadBalancerName 属性一致
  <loadBalancerName>:
    # type 和 props,请参考读写分离负载均衡内置算法:https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/builtin-algorithm/load-balance/
    type: xxx
    props:
      xxx: xxx

影子算法

yaml
shadowAlgorithms:
  # shadowAlgorithmName 由用户指定,需要和影子库规则中的 shadowAlgorithmNames 属性一致
  <shadowAlgorithmName>:
    # type 和 props,请参考影子库内置算法:https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/builtin-algorithm/shadow/
    type: xxx
    props:
      xxx: xxx

脱敏算法

yaml
maskAlgorithms:
  # maskAlgorithmName 由用户指定,需要和脱敏规则中的 maskAlgorithm 属性一致
  <maskAlgorithmName>:
    # type 和 props,请参考脱敏内置算法:https://shardingsphere.apache.org/document/current/cn/user-manual/common-config/builtin-algorithm/mask/
    type: xxx
    props:
      xxx: xxx