当前位置:网站首页>What is the basic principle of MySQL read / write separation
What is the basic principle of MySQL read / write separation
2022-07-20 19:10:00 【Yisu cloud】
MySQL What is the basic principle of read-write separation
This article mainly explains “MySQL What is the basic principle of read-write separation ”, Interested friends might as well come and have a look . The method introduced in this paper is simple and fast , Practical . Now let Xiaobian take you to learn “MySQL What is the basic principle of read-write separation ” Well !
One 、 Working principle of read-write separation
In some large website business scenarios , Single database The server The amount of concurrency that can be provided can no longer meet the business needs , To satisfy this situation , Generally speaking, it synchronizes data through master-slave synchronization , On this basis , Improve the concurrency and load capacity of the database by separating read from write .
generally speaking , In the business scenario, the query operation of the database is much higher than the increase 、 Deletion and modification , And the read operation has less impact on the database . therefore , We usually set up a database server as the main server , Mainly responsible for the increase of data 、 Deleted and modified tasks , To configure 3-4 Database servers are slave servers , It mainly undertakes the task of data query . The database slave server synchronizes data from the database master server , In order to achieve data consistency .
Two 、 Read write separation implementation mode
According to the level of read-write separation , There are generally two ways to realize read-write separation , Through the application layer and through the middleware layer .
Implementation through the application layer refers to the implementation of data query language and data operation language within the web page, pointing to different MySQL Master and slave Libraries . Implemented through the application layer MySQL The diagram of separation of reading and writing is as follows :
The advantage of this is that it reduces the difficulty of deployment , Deploy and install , And good performance , The disadvantage is that the code needs to be modified when the architecture is expanded , It is difficult to realize automatic database distribution 、 Advanced operations such as table splitting , It is not very applicable in some large application scenarios .
Implementation through the middleware layer refers to the unified integration of all... In the application layer SQL The statement points to a middleware device , The middleware device will be different SQL Statement points to different database servers for operation . The diagram of reading and writing separation through the middleware layer is as follows :
The advantage of this is that the architecture design is more flexible , Less impact on business code , Good portability , And it can realize advanced control , However, this architecture requires professional operation and maintenance personnel to maintain the architecture .
3、 ... and 、 Common middleware for read-write separation
There are the following kinds of commonly used read-write separation middleware programs :
1、cobar
Ali B2B Developed relational distributed system , Is an early middleware , Later, no one maintained it because the developer left .
2、MyCAT
Technology lovers are cobar On the basis of the second development , It's solved cobar Some of the problems , And added some new features , at present MyCAT Community activity is high , There are also a lot of companies using MyCAT.
3、OneProxy
Oneproxy It's a middleware for commercial charging , Developed by Alipay team , It is very stable in high concurrency scenarios .
4、Vitess
The middleware architecture is complex , And the use of Vitess You need to use the API Interface .
5、Kingshard
from 360 Team development , Support sub database and sub table , But in the case of high concurrency, the stability is general .
6、MaxScale and MySQL Route
Both are MySQL Official middleware .Maxscale yes Mariadb R & D ,MySQL Route It's now Oracle Company as MySQL Middleware for database publishing .
Here we are , I'm sure you're right “MySQL What is the basic principle of read-write separation ” Have a deeper understanding of , You might as well put it into practice ! This is the Yisu cloud website , For more relevant contents, you can enter the relevant channels for inquiry , Pay attention to our , Continue to learn !
边栏推荐
- 地学学术资源(常用数据及其下载地址)
- Batch download data -- Take TRMM data as an example
- ArcGIS custom coordinate system (taking Albers as an example)
- 欧洲气象中心资料(ERA)下载方法
- ExpandableListView嵌套Gridview显示不全的问题
- Matlab TRMM_ 3b42 data format conversion (NC to TIF, with code)
- matlab获取原数组在排序后数组中的位置
- cobbler离线安装
- 传统 token 方式和 jwt 在认证方面的差异
- Matlab实现优劣解距离法(TOPSIS法)
猜你喜欢
接口调试还能这么玩?
MATLAB实现LMDI分解方法(含零值处理)
MATLAB绘制环形比例图
Batch download data -- Take TRMM data as an example
MATLAB realizes LMDI decomposition method (including zero value processing)
银行业数据安全建设专题分析
Pycharm Debug错误“Process finished with exit code -1073741819 (0xC0000005)”解决方案
MATLAB回归分析获取预测变量的系数和p值和R2(仅一行代码)
教你使用CANN将照片一键转换成卡通风格
Draw scatter density diagram with MATLAB
随机推荐
Pycharm Debug错误“Process finished with exit code -1073741819 (0xC0000005)”解决方案
MATLAB realizes the distance method of superior and inferior solution (TOPSIS method)
浏览器兼容性问题及常见的解决方法
地学学术资源II
ArcGIS导出地图后部分图例不显示
Matlab计算质心
Go基础笔记_5_流程语句
Go语言——测试与性能
XSS (cross site scripting attack) vulnerability understanding
R语言“Error in nls 循环次数超过了50”解决方案
Map and set
Matlab TRMM_3B42数据格式转换(nc转tif,附代码)
SQL中方括号的用途
If the total is based on the frame form by field, sort by a field
Force deduction solution summary 731- my schedule II
oracle建表语句模板
tp5.1 foreach在控制器记录中新增加一个字段,其它字段不变也不用重新全部写一遍 (不在模板中操作)(分页)
Geoscience Academic Resources II
101 questions in software testing interview (with answers)
Implementation scheme of importing thinkphp6 million xlsx tables into the database