Forráskód Böngészése

完成动态按时间分库分表

赵冬冬 3 éve
szülő
commit
193cfb9f0c

+ 20 - 1
README.md

@@ -1,4 +1,23 @@
 # springboot-shardingsphere-jdbc
 ##作者:赵冬冬
 #文档地址
-https://shardingsphere.apache.org/document/4.1.1/cn/overview/
+    https://shardingsphere.apache.org/document/4.1.1/cn/overview/
+
+
+#分库分表
+    
+    减少使用 left join 也无法跨库查询
+    
+    join无法跨库查询 
+    
+    避免笛卡尔查询
+
+#公共表
+    使用类似于枚举值表
+    菜单表,字典表
+    所有使用的库和表都要插入公共表和数据并且保证数据一致
+
+#读写分离
+    sharding-jdbc 只负责数据的路由不负责数据的同步自己做 mysql的binlog日志
+    
+    

+ 3 - 8
src/main/java/com/xin/shardingspherejdbcdemo/config/sharding/TableShardingAlgorithm.java

@@ -6,14 +6,9 @@ import org.apache.shardingsphere.api.sharding.standard.PreciseShardingValue;
 import org.springframework.stereotype.Component;
 
 import java.util.Collection;
-import java.util.Date;
-
-/*
- * @author :zjq
- * @date :2020/11/9 10:44
- * @description: TODO       数据表分表策略 TableShardingAlgorithm
- * @version: V1.0
- * @slogan: 天下风云出我辈,一入代码岁月催
+
+/**
+ * by zdd
  */
 @Slf4j
 @Component