Sharding JDBC 可以配置读写分离,但是读操作不能设置走写库,所以实时性要求高的表尽量不要做读写分离

绑定子表的 字段名必须和主表相同,并且要配置相同的分库与分片策略。

官网:
https://shardingsphere.apache.org/index_zh.html

文档:
https://shardingsphere.apache.org/document/current/cn/user-manual/shardingsphere-jdbc/
image.png

对比

ShardingSphere-JDBC ShardingSphere-Proxy ShardingSphere-Sidecar
数据库 任意 MySQL/PostgreSQL MySQL/PostgreSQL
连接消耗数
异构语言 仅Java 任意 任意
性能 损耗低 损耗略高 损耗低
无中心化
静态入口

ShardingSphere-JDBC 的优势在于对 Java 应用的友好度。