MySQL master-slave copy some of the things sorted

Source: Internet
Author: User

Recently to the new on-line project to build a master-slave structure, so organize some useful things out, for record:

One. MySQL's master-slave replication scenario:

MySQL master-slave replication facilitates the robustness of database structures, improves access speed and facilitates maintenance management.

1). master-slave servers are backed up by each other

The design of the master-slave server architecture can greatly enhance the robustness of the database architecture. For example, when there is a problem with the primary server, we can manually or automatically switch to continue to service from the server.

This is similar to NFS, where NFS storage data is synchronized to the backup via Inotify+rsync, except that the MySQL synchronization scheme is its own tool.

2). master-Slave server read and write separate share site pressure:

The architecture of the master-slave server can be read/write separated from the user's request through the program (Php,java) or proxy software (Mysql-proxy,amoeba), that is, by simply processing the Select check on the slave server

queries, reducing the user's query time and the pressure on the primary server for both read and write, and for the updated data (update insert Delete) is still given to the primary server to ensure that the primary server

And from the server to maintain real-time synchronization, if the site is a non-update-based business, such as Blog,www's home display and other services, query more requests, which is from the server read and write separation load balancing policy

is very effective, this is the read-write separation data structure.

Medium and large companies: through the program (Php,java)

Test environment: Agent Software (Mysql-proxpy,amoeba)

Portal: Distributed Dbproxy (read/write separation, hash load balancing, health check).

The following is a common MySQL architecture:

    

MySQL master-slave copy some of the things sorted

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.