6:短链接表的分表
dataSources:
ds_0:
dataSourceClassName: com.zaxxer.hikari.HikariDataSource
driverClassName: com.mysql.cj.jdbc.Driver
jdbcUrl: jdbc:mysql://127.0.0.1:3306/link?useUnicode=true&characterEncoding=UTF-8&rewriteBatchedStatements=true&allowMultiQueries=true&serverTimezone=Asia/Shanghai
username: root
password: 171612Cgj.
rules:
- !SHARDING
tables:
t_link:
actualDataNodes: ds_0.t_link_${0..15}
tableStrategy:
standard:
shardingColumn: gid
shardingAlgorithmName: link_table_hash_mod
t_link_goto:
actualDataNodes: ds_0.t_link_goto_${0..15}
tableStrategy:
standard:
shardingColumn: full_short_url
shardingAlgorithmName: link_goto_table_hash_mod
t_group:
actualDataNodes: ds_0.t_group_${0..15}
tableStrategy:
standard:
shardingColumn: username
shardingAlgorithmName: group_table_hash_mod
shardingAlgorithms:
link_table_hash_mod:
type: HASH_MOD
props:
sharding-count: 16
link_goto_table_hash_mod:
type: HASH_MOD
props:
sharding-count: 16
group_table_hash_mod:
type: HASH_MOD
props:
sharding-count: 16
props:
sql-show: true