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

  • 相关阅读:
    简单理解OOP——面向对象编程
    SpringMVC拦截器
    Vue简洁及基本用法
    springMVC实现文件上传下载
    Python笔记⑤爬虫
    Python笔记4
    Python笔记3
    Python基础语法笔记2
    Python基础入门语法1
    Navicat连接mysql时候出现1251错误代码
  • 原文地址:https://www.cnblogs.com/television/p/14605547.html
Copyright © 2020-2023  润新知