摘要 |
The present invention relates to data synchronization and discloses a method and a system for data synchronization and a relevant device. The data synchronization includes: in a process of database-level synchronization between a first database and a second database, sending a request for creating a transaction to the first database, where the request includes an operation command required for executing the transaction; when the first database executes the transaction, acquiring a sequence number from the first database, and sending the operation command required for executing the transaction and the sequence number corresponding to the transaction to a temporary storage queue for storage; acquiring a switching sequence number from the second database when a database-level synchronization link between the first database and the second database is disconnected; determining a sequence number that is stored in the temporary storage queue and follows the switching sequence number, and sending the operation command required for executing the transaction corresponding to the determined sequence number to the second database, so as to implement application-level data synchronization. The present invention may be used to avoid interrupting access of a third-party device to a database in a process of database synchronization. |