Preliminary Study on MySQL Replication

Source: Internet
Author: User

Simply put, replication is actually a mechanism for synchronizing data between databases. It replays binary logs generated on the master database in the slave database to synchronize data between the master and slave databases.

Replication is relatively good for scaling reads, which you can direct to a slave, but it's not a good way to scale writes unless you design it right.

Relatively speaking, the replication mechanism is especially suitable for horizontal scaling (scale out) of reads, which is also the purpose of many systems to implement read/write splitting through replication. For many systems, the read/write ratio is not equal. In many cases, read operations are much more than write operations. In this case, data is written to the master database through replication, when reading data, the data is hashed to a slave database, which disperses the read pressure. That is to say, it provides conditions for read operations to achieve load balancing.

From this point of view, the current master-slave Database Design of the forum system does not improve the overall performance of the system. Because our write operations are also very frequent. In this way, when the slave database constantly synchronizes the new data captured by the master database, it is also frequently read by the statistical analysis process, resulting in a low performance of the slave database.

Is the working mechanism of replication:

 

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.