How to implement read/write splitting in php + mysql
Source: Internet
Author: User
Php + mysql implements read/write splitting. the master/slave database is ready. how to implement read/write splitting is to encapsulate database operations and connect different operations to different databases, I have taken a look at a piece of stuff on google. I don't know if this is good or not. http://code.google.com/p/mysql-rw-php/. it seems that the two data libraries of MS are deployed first, and php links to php + mysql to implement read/write splitting
The master-slave database is ready. how to implement read/write splitting is to encapsulate database operations and connect different operations to different databases. I have referred to a piece of stuff on google, I don't know.
Http://code.google.com/p/mysql-rw-php/
------ Solution --------------------
It seems that the two databases of MS are matched first, and then php connects to the two databases at the same time, and then the two databases can be used. when data is written, the data that is "written" will be written to the database that is "read" at the same time, which is made by the mysql replication machine.
------ Solution --------------------
Read/write splitting generally requires the establishment of a master-slave database.
Insert the primary database and copy it to the slave database.
Only the slave database is queried.
------ Solution --------------------
Very good !!!!!!!!!!!!!!!!
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service