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

  • 相关阅读:
    matlab基本数据结构struct
    matlab基本函数strcmp num2str 字符串格式
    matlab基本函数inf, isempty, round, floor, fix
    matlab基本函数randperm end数组索引
    matlab基本函数find
    【未通过】LintCode #366 斐波纳契数列
    LintCode #3 统计数字
    计算1至n中数字X出现的次数
    LintCode #2 尾部的零
    LintCode #1 A + B 问题
  • 原文地址:https://www.cnblogs.com/television/p/14605547.html
Copyright © 2011-2022 走看看