1 Star 0 Fork 38

ve/shopTNT商城系统-系统配置中心

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
application-member.yml 2.45 KB
一键复制 编辑 原始数据 按行查看 历史
妙贤 提交于 2022-11-10 10:53 . 开放源码
spring:
#分库分表配置
shardingsphere:
sharding:
tables:
#商品表(用member_id分库,用member_id分表)
es_member:
actual-data-nodes: ds$->{0..1}.es_member$->{0..1}
database-strategy:
inline:
sharding-column: member_id
algorithm-expression: ds$->{member_id% 2}
table-strategy:
inline:
sharding-column: member_id
#因为都是使用同一个字段进行分库分表的所以要右移两位之后取模以保证每个表中的数据平均
algorithm-expression: es_member$->{(member_id>>2)% 2}
#商品表(用member_id分库,用member_id分表)
es_clerk:
actual-data-nodes: ds$->{0..1}.es_clerk$->{0..1}
database-strategy:
inline:
sharding-column: member_id
algorithm-expression: ds$->{member_id% 2}
table-strategy:
inline:
sharding-column: member_id
#因为都是使用同一个字段进行分库分表的所以要右移两位之后取模以保证每个表中的数据平均
algorithm-expression: es_clerk$->{(member_id>>2)% 2}
#es_shop_notice_log
es_shop_notice_log:
actual-data-nodes: ds$->{0..1}.es_shop_notice_log$->{0..1}
database-strategy:
inline:
sharding-column: id
algorithm-expression: ds$->{id % 2}
table-strategy:
inline:
sharding-column: shop_id
algorithm-expression: es_shop_notice_log$->{shop_id % 2}
#es_member_notice_log
es_member_notice_log:
actual-data-nodes: ds$->{0..1}.es_member_notice_log$->{0..1}
database-strategy:
inline:
sharding-column: id
algorithm-expression: ds$->{id % 2}
table-strategy:
inline:
sharding-column: member_id
algorithm-expression: es_member_notice_log$->{member_id % 2}
es_member_wallet:
actual-data-nodes: ds$->{0..1}.es_member_wallet$->{0..1}
database-strategy:
inline:
sharding-column: id
algorithm-expression: ds$->{id % 2}
table-strategy:
inline:
sharding-column: member_id
algorithm-expression: es_member_wallet$->{member_id % 2}
#binding-tables: es_order,es_order_items
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/yeasue/shopTNT_config.git
git@gitee.com:yeasue/shopTNT_config.git
yeasue
shopTNT_config
shopTNT商城系统-系统配置中心
main

搜索帮助

23e8dbc6 1850385 7e0993f3 1850385