zoukankan      html  css  js  c++  java
  • shardingjdbc核心概念理解汇总

    一、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、水平切分:通过表中某个字段,以该字段进行计算规则后,得出需要存放的表,扩展相对自由

  • 相关阅读:
    yum只下载不安装的方法
    在VS2008下编译Qt4.4.x
    Linux sh脚本异常:bad interpreter: No such file or directory
    动态链接库dll,静态链接库lib, 导入库lib 转
    Accumulation Buffer(累积缓存)
    mysql中ip和整数的转换
    开车撞人了!
    windows 下getc()返回0x1A表示EOF
    NPC问题
    关于普华永道、麦肯锡和IBM的笑话
  • 原文地址:https://www.cnblogs.com/television/p/14605547.html
Copyright © 2011-2022 走看看