Database read-write separation and payment callback operations

Source: Internet
Author: User
I'm thinking of the database do read (a) write (b) detach, if you encounter a payment callback, there is definitely a transaction in the middle, need to query (a) and write (b), operation of multiple different host library (a, b), how to maintain data integrity

such as pay callback, first verify, in the open transaction, go to a, write B, check A, write B, the transaction will not be a problem?

Use of the database read and write separation, callback payment must be read and write more, how to ensure that a transaction can be successful transaction operations

Reply content:

I'm thinking of the database do read (a) write (b) detach, if you encounter a payment callback, there is definitely a transaction in the middle, need to query (a) and write (b), operation of multiple different host library (a, b), how to maintain data integrity

such as pay callback, first verify, in the open transaction, go to a, write B, check A, write B, the transaction will not be a problem?

Use of the database read and write separation, callback payment must be read and write more, how to ensure that a transaction can be successful transaction operations

First of all, to make it clear that the open transaction is for a database, that is, for the primary database, you can not go to the database query (also can not go from the database query, because the lock operation of the query is a write operation), so overall, the entire transaction operation should be for the primary database, There is no question of what you mean by going to a and then writing to B.

Landlord's business volume if very large can consider the sub-library to install the user's ID to take the rest of the library and performance problems can also solve the problem of things can also solve my company's business is to use the sub-Library

@junze the problem of the library, your master-slave library data synchronization is real-time? What business scenarios are the main and slave libraries divided into? How to ensure the data consistency problem of master and slave library?

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