About a MySQL database master-slave configuration problem

Source: Internet
Author: User
Keywords Php mysql nginx

Now to do the MySQL database master and slave configuration, there are several ways, do not know which kind of better:

1 through PHP code to achieve, if it is selest to go from the database (read), or go to the main database (write)

2 Handling via Nginx

3 through MySQL's own configuration to achieve

Do not know which extensibility and maintainability is a little better

Reply content:

Now to do the MySQL database master and slave configuration, there are several ways, do not know which kind of better:

1 through PHP code to achieve, if it is selest to go from the database (read), or go to the main database (write)

2 Handling via Nginx

3 through MySQL's own configuration to achieve

Do not know which extensibility and maintainability is a little better

MySQL configuration is better, because Master and slave is not only to improve the efficiency of read operations, but also to consider the master-slave replication and backup situation

MySQL has configured a master-slave backup to build an Atlas machine, and then rely on the atlas for read and write separation, configured to automatically write to master, for high-real-time data can also be forced to specify the read operation of the Master

Read-write separation, and then use Cobar or TDDL, according to a certain routing rules, the data to be written to the database sub-table operation. At the same time, the scheduled task, real-time data to write the database synchronization to read the database.

  • 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.