Collision avoidance in database replication systems
First Claim
Patent Images
1. A method of replicating data associated with a plurality of transactions in a replication system including a plurality of nodes connected via communication media in a topology, each node including a database, the method comprising:
- (a) replicating the data from an originating node to one or more other nodes, each transaction being one or more transaction steps or transaction operations; and
(b) pausing each transaction that is requested to be executed in the database at an originating node prior to a first I/O operation for the transaction upon detection that synchronization between the database at the originating node and the database at one or more of the other nodes cannot be ensured.
7 Assignments
0 Petitions
Accused Products
Abstract
Database replication systems replicate blocks of transaction steps or operations with synchronous replication, and perform dual writes with queuing and blocking of transactions. Tokens are used to prepare a target database for replication from a source database and to confirm the preparation. Database replication systems switch between a synchronous replication mode and an asynchronous replication mode, and then back to a synchronous replication mode, based on detection of selected events.
121 Citations
41 Claims
-
1. A method of replicating data associated with a plurality of transactions in a replication system including a plurality of nodes connected via communication media in a topology, each node including a database, the method comprising:
-
(a) replicating the data from an originating node to one or more other nodes, each transaction being one or more transaction steps or transaction operations; and (b) pausing each transaction that is requested to be executed in the database at an originating node prior to a first I/O operation for the transaction upon detection that synchronization between the database at the originating node and the database at one or more of the other nodes cannot be ensured. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9, 10, 11)
-
-
12. A method of synchronizing plural databases in a database replication system including a plurality of nodes connected via communication media in a topology, each node including (i) a database, and (ii) a transaction transmitter which sends selected transactions posted to the database to one or more other nodes, each transaction being one or more transaction steps or transaction operations, the method comprising:
-
(a) a transaction transmitter at a first node collecting a block of transaction steps or transaction operations posted to a source database at the first node; (b) the transaction transmitter at the first node sending the block of transaction steps or transaction operations to a second node having a target database for posting thereto; (c) repeating steps (a) and (b) for additional blocks of transaction steps or transaction operations in the source database; and (d) inhibiting a commit operation at either the source database or the target database until it can be ensured that the source database and the target database can both be successfully updated with the transaction steps or transaction operations, the transactions, thus being replicated using a synchronous replication mode. - View Dependent Claims (13, 14, 15, 16, 17, 18, 40)
-
-
19. A method of performing dual writes in a database replication system that includes (i) a local application which receives transactions, each transaction being one or more transaction steps or transaction operations, (ii) a local database associated with the local application process, and (iii) a remote database, the method comprising:
-
(a) at the local application, queuing a plurality of transaction steps or transaction operations; (b) sending a block of queued transaction steps or transaction operations to the remote database for posting thereto; (c) repeating steps (a) and (b) for additional blocks of transaction steps or transaction operations collected at the local application; and (d) inhibiting a commit operation at either the local database or the remote database until it can be ensured that the local database and the remote database can both be successfully updated with the transaction steps or transaction operations, the transactions thus being replicated using a synchronous replication mode. - View Dependent Claims (20, 21, 41)
-
-
22. A method of avoiding collisions in a database replication system including a plurality of nodes connected via communication media in a topology, each node including a database, at least some of the nodes being able to independently receive and post transactions, the method comprising:
-
(a) pausing each transaction being executed in the database at an originating node prior to a commit operation for the transaction; (b) assigning a ready to commit token to the transaction; (c) sending the ready to commit token to the one or more other nodes; (d) determining at the one or more other nodes whether the respective databases are prepared for a commit operation for the transaction corresponding to the ready to commit token, and, if so, sending back the ready to commit token to the originating node; and (e) executing a commit operation at the database of the originating node only upon receipt from at least one of the other nodes of the ready to commit tokens originally sent from the originating node. - View Dependent Claims (23)
-
-
24. A method of avoiding collisions in a database replication system including a plurality of nodes connected via communication media in a topology, each node including a database, at least some of the nodes being able to independently receive and post transactions, the method comprising:
-
(a) pausing each transaction being executed in the database at an originating node prior to a commit operation for the transaction; (b) assigning a ready to commit token to the transaction; (c) sending the ready to commit token to the one or more other nodes; and (d) determining at the one or more other nodes whether the respective databases are prepared for a commit operation for the transaction corresponding to the ready to commit token, and, if so, executing the commit operation at the one or more other nodes before a commit operation is performed at the originating node. - View Dependent Claims (25)
-
-
26. A method of replicating data associated with a plurality of transactions in a replication system including a plurality of nodes connected via communication media in a topology, each node including (i) a database, (ii) a replication engine which performs data replication functions, and (iii) an application which executes transactions and posts the transactions to the database, the application being independent of the replication engine, each transaction being one or more transaction steps or transaction operations, the method comprising:
-
(a) an application at a first node pausing each transaction being executed in a source database at the first node prior to a commit operation for the transaction; (b) a replication engine at the first node assigning a ready to commit token to the transaction in coordination with the application; (c) the replication engine at the first node sending the ready to commit token to the second node; (d) a replication engine at a second node determining whether a target database at the second node is prepared for a commit operation for the transaction corresponding to the ready to commit token, and, if so, sending back the ready to commit token to the first node; and (e) the application at the first node executing a commit operation at the source database in coordination with the replication engine only upon receipt from the second node of the ready to commit token originally sent from the first node.
-
-
27. A method of synchronizing plural databases in a database replication system including a plurality of nodes connected via communication media in a topology, each node including a database, each database including a plurality of records, each record having an associated key, each transaction being one or more transaction steps or transaction operations, the method comprising:
-
(a) initially sending only keys of database records in a source database at a first node that are desired to be replicated to a target database at a second node as a result of a transaction; (b) using the keys at the target database to prepare the target database for a subsequent commit operation; (c) pausing each transaction being executed in the source database at the first node prior to a commit operation for the transaction; (d) assigning a ready to commit token to the transaction; (e) sending the ready to commit token to the second node; (f) determining whether a target database at the second node is prepared for a commit operation for the transaction corresponding to the ready to commit token, and, if so, sending back the ready to commit token to the first node; and (g) executing a commit operation at the source database only upon receipt from the second node of the ready to commit token originally sent from the first node. - View Dependent Claims (28, 29)
-
-
30. A method of determining when to switch from a synchronous replication mode to an asynchronous replication mode in a database replication system including a plurality of nodes connected via communication media in a topology, each node including a database, at least some of the nodes being able to independently receive and post transactions, the method comprising:
-
(a) pausing each transaction being executed in the database at an originating node prior to a commit operation for the transaction; (b) assigning a ready to commit token to the transaction; (c) sending the ready to commit token to the one or more other nodes; (d) determining at the one or more other nodes whether the respective databases are prepared for a commit operation for the transaction corresponding to the ready to commit token, and, if so, sending back the ready to commit token to the originating node; and (e) switching from a synchronous replication mode to an asynchronous replication mode if the originating node does not receive back the ready to commit token that it has originally sent to any of the other nodes, the switching occurring only for the nodes that the originating node does not receive back a token. - View Dependent Claims (31)
-
-
32. A method of determining when to restore a synchronous replication mode in a replication system which replicates data associated with a plurality of transactions, the system including a plurality of nodes connected via communication media in a topology, each node including a database, wherein the system normally operates in a synchronous replication mode, but switches to an asynchronous replication mode when synchronization between a database at an originating node and a database at one or more of the other nodes cannot be ensured, the method comprising:
-
(a) detecting replication latency; and (b) restoring the synchronous replication mode when synchronization between a database at an originating node and a database at one or more of the other nodes can be ensured again and replication latency becomes less than a predetermined time value. - View Dependent Claims (33)
-
-
34. A method of routing transaction inputs in a bidirectional replication system which replicates data associated with a plurality of transactions, the system including a plurality of nodes connected via communication media in a topology, each node including a database, wherein the system normally operates in a synchronous replication mode, but switches to an asynchronous replication mode when synchronization between a database at an originating node and a database at one or more of the other nodes cannot be ensured, the method comprising:
-
(a) selecting a winning node upon switching to an asynchronous replication mode; and (b) routing all transaction inputs at the other nodes to the winning node during the time period of asynchronous replication.
-
-
35. A method of addressing collisions upon restoring a synchronous replication mode in a replication system which replicates data associated with a plurality of transactions, the system including a first node and a second node, each node including a database, wherein the system normally operates in a synchronous replication mode, but switches to an asynchronous replication mode when synchronization between a database at the first node and a database at the second node cannot be ensured, the method comprising:
-
(a) detecting that the synchronous replication mode may be restored; (b) sending all queued transactions at each node that do not cause any collision to the other node in their order of occurrence; (c) resolving any collisions in the remaining queued transactions and sending the resolved transactions to the respective nodes; and (d) upon completion of steps (b) and (c), switching back to the synchronous replication mode. - View Dependent Claims (36, 37, 38, 39)
-
Specification