Mysqlproxy was the first time I heard this word in a new project. Can anyone tell me why I want to use him. We did this in the previous master-slave database. There is a way to execute the SQL statement to him every time, and then he chooses whether to connect to the master database or slave database, if the first six letters contain s... mysql proxy was the first time I heard this word in a new project. Can anyone tell me why I want to use him.
We did this in the previous master-slave database. There is a way to execute the SQL statement to him every time, and then he chooses whether to connect to the master database or slave database, if the first six letters contain select, read the slave database. If not, read the master database.
But I heard this word today. Why should I use it for read/write splitting? Or is our previous practice wrong? mysql proxy is usually used for read/write splitting?
Reply content:
Mysql proxy was the first time I heard this word in a new project. Can anyone tell me why I want to use him.
We did this in the previous master-slave database. There is a way to execute the SQL statement to him every time, and then he chooses whether to connect to the master database or slave database, if the first six letters contain select, read the slave database. If not, read the master database.
But I heard this word today. Why should I use it for read/write splitting? Or is our previous practice wrong? mysql proxy is usually used for read/write splitting?
Read/write splitting and load balancing
You don't need to write it yourself.
To implement read/write splitting by yourself, many things that need to be considered are actually not applicable to various situations simply by checking the select statement. for example: for update
If you do not want to use mysql proxy and you only need to check the select statement to meet your requirements. The mysqlnd_ms extension in php can effectively solve the read/write splitting problem.