MySQL Master/Slave replication and read/write Separation

Source: Internet
Author: User

MySQL Master/Slave replication and read/write Separation

The so-called read/write splitting is to prepare two types of MySQL Databases in advance, one for update (master) and the other for query (slave ). When the application system needs to update data, it calls the master and slave when querying data. The advantage of doing so is to share the business processing of a single database with multiple databases. It can also be understood as Server Load balancer, so there is a problem, when will the master data be synchronized to slave? At this time, Master-Slave replication is used. Master-Slave replication provides multiple ways to synchronize data from the Master to the Slave. For more information about how to practice, see other articles on the network.

The following figure shows the system structure:

As mentioned above, the use of Master-slave replication to achieve read/write splitting improves the load capacity of the system. In fact, a Master should be added to achieve high availability of the database system, in this way, even if any of the database servers goes down, the system service usage will not be affected.

For details about how to implement read/write splitting and high availability of the application system, see configuring multiple data sources in the spring Project, use the aop entry point to call the master data source based on methods such as save *, update *, and delete *, and call the slave Data Source Based on find *, get *, and query.

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.