当前位置:网站首页>ShardingSphere-数据库分库分表简介
ShardingSphere-数据库分库分表简介
2022-07-24 22:48:00 【小姐姐修灯泡吗】
一、简介
shardingsphere 是一套开源的分布式数据库中间件的产品。旗下有两个比较重要的产品sharding jdbc 和sharding proxy
1.sharding jdbc :从图中可以清楚看到,是嵌入到应用程序中,所有的分库分表逻辑都是有开发人员自己控制,功能相对灵活,但是对业务侵入性较大。可理解为增强版的 JDBC 驱动,完全兼容 JDBC 和各种 ORM 框架

2.sharding proxy:从图中中可以清晰看到,他是独立部署的,目前支持mysql和postgresql。对业务零侵入,就像是对接一个mysql服务一样,感觉不到他的存在,但是也正是如此,功能不够灵活单调。(类似mycat)
二、核心概念
1.逻辑表:定义逻辑库名和逻辑表
2.真实表:分片中真是的物理表
3.数据节点:数据源和数据表组成
4.绑定表:分片规则必须完全一致的主子表(主外键的表,很重要,必须分片规则一致)
5.广播表:每个分片中都有的表(冗余表例如字典表)
6.分片键:指定某个字段为分片建(一般为主键)
7.分片算法:通过算法将数据分发到不同的片,支持=,between和in分片,开发者自定义实现,灵活度高
8.分片策略:真正进行的分片操作是分片键+分片算法。
三、优缺点
分库分表虽然解决了单机容量的问题,但是也带来了很多问题,
例如jdbc业务侵入大,业务的sql不再是单纯的在机器上运行,对大量的跨纬度join,聚合,子查询。排序等功能很难支持。大大弱化了数据库的功能。所以一般能不分就不分,能使用分布式数据库就使用分布式数据库库,或者加上缓存,es等方式优先解决。
边栏推荐
- Connector in C
- 关于板载继电器供电不足引起不能吸合的问题
- From violent recursion to dynamic programming, memory search
- Let‘s Encrypt
- RichTextBox save as picture
- 一文读懂Elephant Swap的LaaS方案的优势之处
- Network Security Learning (V) DHCP
- Org.json Jsonexception: what about no value for value
- 洛谷 P2024 [NOI2001] 食物链
- Use kettle to read the data in Excel file and store it in MySQL
猜你喜欢

谢振东:公共交通行业数字化转型升级的探索与实践

老杜Servlet-JSP
WPF uses pathgeometry to draw the hour hand and minute hand

单调栈结构练习——子数组最小值的累加和

burp从溯源到反制思路

Monotonic stack structure exercise -- cumulative sum of minimum values of subarrays

Oracle中实现对指定数据分组且获取重复次数

Application programming of communication heartbeat signal for communication abnormality judgment

高阶产品如何提出有效解决方案?(1方法论+2案例+1清单)

Ranking of engineering project management software
随机推荐
NVIDA-TensorRT部署(一)
Baidu online disk +chrome plug-in
单调栈结构练习——子数组最小值的累加和
"Fundamentals of program design" Chapter 10 function and program structure 6-13 divide and conquer method to solve the gold bullion problem (20 points)
[1184. Distance between bus stops]
QT learning vs creating QT items shows instances where object references are not set to objects
AVL tree of ordered table
"Fundamentals of program design" Chapter 10 function and program structure 7-2 Hanoi Tower problem (20 points)
[cloud native kubernetes] kubernetes cluster advanced resource object staterulesets
Ranking of engineering project management software
高阶产品如何提出有效解决方案?(1方法论+2案例+1清单)
Old Du servlet JSP
WPF opens external programs and activates them when needed
IndexTree2D
Read and understand the advantages of the LAAS scheme of elephant swap
谢振东:公共交通行业数字化转型升级的探索与实践
Network Security Learning (IV) user and group management, NTFS
The rule created by outlook mail is invalid. Possible reasons
RichTextBox operation
郑慧娟:基于统一大市场的数据资产应用场景与评估方法研究