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?