YII2 cross-server thing processing?

Source: Internet
Author: User
Keywords PHP transaction processing
Development language PHP, Development framework YII2, database MySQL (all hard conditions)
Status: Due to business requirements, the database will be distributed on different servers, the server has business dealings
Problem 1:YII2 concurrent multi-server, but PHP does not support Kua server things processing, how to ensure the accuracy of data
Problem 2:yii2 modify three data, three data on three servers respectively, processing time incredibly up to 15 seconds, a single operation is normal. The YII2 database is dynamically connected.
Question 3: In meeting the hard conditions, please give the solution to the master.

Reply content:

Development language PHP, Development framework YII2, database MySQL (all hard conditions)
Status: Due to business requirements, the database will be distributed on different servers, the server has business dealings
Problem 1:YII2 concurrent multi-server, but PHP does not support Kua server things processing, how to ensure the accuracy of data
Problem 2:yii2 modify three data, three data on three servers respectively, processing time incredibly up to 15 seconds, a single operation is normal. The YII2 database is dynamically connected.
Question 3: In meeting the hard conditions, please give the solution to the master.

1, if Yii connected to a number of different databases at the same time, then the comparison, this you in addition to the asynchronous queue to accelerate there is no good way, if it is a master more from, yii in the execution of the transaction at the time to always execute SQL on the main;
2. Ibid.
3, you can consider a master multi-slave mode, execute the transaction quickly. If it is three different business systems, and demand data must be real-time, hehe. I can assume that the execution time is 0, the optical connection time, not acceptable ...

YII2 modified three data, three data on three servers, processing time incredibly up to 15 seconds, a single operation is normal
Whether there is data to locate troubleshooting issues. You can try to pinpoint where the problem is.

You might consider splitting the business with a queue.

Schema has a problem, PHP written to MySQL, which MySQL is not done by PHP, using MySQL middleware to proxy these operations

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