PHPMYSQL read/write splitting

Source: Internet
Author: User
I would like to ask you the idea of using php for read/write splitting. Is there a simple method for synchronization (or even without any php code modifications) to implement or similar functions? (I am very lazy) I would like to ask you about the idea of using php for read/write splitting and the synchronization problem,

Is there a simple way to implement or perform similar functions without making any changes to the php code?

(I am very lazy)

Reply content:

I would like to ask you the idea of using php for read/write splitting and the synchronization problem,

Is there a simple way to implement or perform similar functions without making any changes to the php code?

(I am very lazy)

Read/write splitting without any php code modification. Of course, we recommend the official mysqlnd-ms extension of php!

Let's just take a look at the SQL statement. When the select statement starts, the slave database is connected, and the other master databases are connected. The change volume is still small.

Of course you can. mysql Master/Slave solves this problem.

Certainly, as you can't move the code, it's what O & M DBAs need to do. All mysql reads and writes are allocated to different DB databases for data, and master-slave synchronization is configured, ensure data consistency

Try mysql-proxy and so on. There are many similar middleware Products available. You can search for them online.

1. Use the framework to switch between read splitting, which is very convenient.
2. Use Mysql middleware to automatically separate read/write requests to different servers. The Mysql Master/Slave mentioned by others cannot solve your problem. You need to add read/write splitting on the basis of the Master/Slave. Middleware such as mysql-proxy, Atlas, for more comparisons see: http://www.guokr.com/blog/475765/

Use mysql cluster

I really think this is a good Community, so many people who are interested in it.

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.