File tree Expand file tree Collapse file tree 2 files changed +22
-5
lines changed
Expand file tree Collapse file tree 2 files changed +22
-5
lines changed Original file line number Diff line number Diff line change @@ -248,10 +248,12 @@ mycat:自己上官网,找一个官网最基本的例子,自己写一下,
248248orderId 模 32 = 库
249249orderId / 32 模 32 = 表
250250
251- 259 3 8
252- 1189 5 5
253- 352 0 11
254- 4593 17 15
251+ orderId 库 表
252+
253+ 259 3 8
254+ 1189 5 5
255+ 352 0 11
256+ 4593 17 15
255257
2562581、设定好几台数据库服务器,每台服务器上几个库,每个库多少个表,推荐是32库 * 32表,对于大部分公司来说,可能几年都够了;
257259
@@ -263,4 +265,6 @@ orderId / 32 模 32 = 表
263265
2642665、我们这边就是修改一下配置,调整迁移的库所在数据库服务器的地址;
265267
266- 6、重新发布系统,上线,原先的路由规则变都不用变,直接可以基于2倍的数据库服务器的资源,继续进行线上系统的提供服务。
268+ 6、重新发布系统,上线,原先的路由规则变都不用变,直接可以基于2倍的数据库服务器的资源,继续进行线上系统的提供服务。
269+
270+ ![ image-20240903130206635] ( https://itsaysay-1313174343.cos.ap-shanghai.myqcloud.com/blog/image-20240903130206635.png )
Original file line number Diff line number Diff line change @@ -224,3 +224,16 @@ select * from a left join b where 条件 只返回where中匹配的数据
224224
225225https://www.cnblogs.com/caowenhao/p/8003846.html
226226
227+ ### Mysql 主从同步延迟问题
228+
229+ 主从同步延迟产生的问题:插入新数据后,立马查询会查不到数据
230+
231+ 1 . 主从同步开启** 并行复制**
232+ 2 . 调整代码,不要插入后,先查询,再更新,如果要更新,插入后直接更新
233+ 3 . 拆库,降低库的并发量,在并发量小的时候(500/s),延迟可以忽略不计
234+ 4 . 这个查询操作直连主库
235+
236+
237+
238+
239+
You can’t perform that action at this time.
0 commit comments