首页 > 数据库技术 > 详细

shardingjdbc核心概念理解汇总

时间:2021-04-01 14:09:35      阅读:18      评论:0      收藏:0      [点我收藏+]

一、SQL表

  分两个库ds0,ds1

  ds0下的表:t_order_0、t_order_1、t_order_item_0、t_order_item_1、t_dict、t_single

  ds1下的表:t_order_0、t_order_1、t_order_item_0、t_order_item_1、t_dict

  1、逻辑表:t_order就是逻辑表

  2、真实表:t_order_0、t_order_1

  3、数据节点:ds0.t_order_0

  4、绑定表:订单表和订单行表都是按照订单号进行分表的,这两个逻辑表就是绑定表,关联查询时无需笛卡尔积查询。

    笛卡尔:select * from o0 join in i0 where xxx;

        select * from o0 join in i1 where xxx;

        select * from o1 join in i0 where xxx;

        select * from o1 join in i1 where xxx;

    绑定表:select * from o0 join in i0 where xxx;

        select * from o1 join in i1 where xxx;

  5、广播表:数据量不大,没个表里都存留一张该表:t_dict字典表符合特征

  6、单表:指所有的分片数据源中只存在唯一一张的表。适用于数据量不大且不需要做任何分片操作的场景。

  7、垂直切分:根据业务关系,按不同的业务分成不同的库,比如用户库、订单库等(缺点:需要对架构进行调整,难以适应业务快速变更,如果单节点数据量大难以扩展)

  8、水平切分:通过表中某个字段,以该字段进行计算规则后,得出需要存放的表,扩展相对自由

shardingjdbc核心概念理解汇总

原文:https://www.cnblogs.com/television/p/14605547.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!