US2016267160A1PendingUtilityA1

Systems and methods for replication replay in a relational database

44
Assignee: CLUSTRIX INCPriority: Jun 1, 2011Filed: May 20, 2016Published: Sep 15, 2016
Est. expiryJun 1, 2031(~4.9 yrs left)· nominal 20-yr term from priority
G06F 16/273G06F 16/21G06F 17/30578G06F 17/30289
44
PatentIndex Score
0
Cited by
0
References
0
Claims

Abstract

Systems and methods for replication replay in a relational database are disclosed. In one embodiment, a relational database includes a master database and a slave database, and events performed on the master database are stored in a log. A portion of the log is provided to a slave replay system associated with the slave database, and the slave replay system identifies a first table row associated with a first event of the portion of the log and a second table row associated with a second event in the portion of the log. The slave replay system replays the first and second events on the slave database in parallel if the first and second rows are different rows with unique sets of values, and otherwise replays the first and second events serially.

Claims

exact text as granted — not AI-modified
What is claimed is: 
     
         1 . A method of replaying transactions in a slave database, the method comprising:
 receiving a sequence of events executed on a master database, the sequence of events associated with one or more tables and at least one transaction of the master database;   identifying a first row of the one or more tables associated with a first event in the sequence;   identifying a second row of the one or more tables associated with a second event in the sequence, the second event after the first event; and   replaying the first and second events on the slave database in parallel if the first and second rows are different rows with unique sets of values, and otherwise replaying the first and second events serially;   wherein the method is performed by one or more computing devices.   
     
     
         2 . The method of  claim 1 , further comprising:
 identifying a third row associated with a third event in the sequence, the third event after the first and second events; and   replaying the first, second and third events on the slave database at least partially in parallel in a first batch if the first, second and third rows each are different rows with unique sets of values.   
     
     
         3 . The method of  claim 2 , further comprising:
 identifying a fourth row associated with a fourth event in the sequence, the fourth event after the first, second and third events; and   replaying the fourth event on the slave database in a second batch after replaying the first batch if the fourth row is the same row as any of the first, second, and third rows, and otherwise replaying the first, second, third and fourth events at least partially in parallel in the first batch if the first, second, third and fourth rows each are different rows with unique sets of values.   
     
     
         4 . The method of  claim 1 , wherein the first and second rows are each associated with a first table of the one or more tables, and wherein identifying the first row associated with the first event includes identifying a first value of the first table associated with the first event, and wherein identifying the second row associated with the second event includes identifying a second value associated with the second event, the first and second values each comprising at least one of: a primary key, a unique key, and column values. 
     
     
         5 . The method of  claim 4 , wherein replaying the first and second events on the slave database comprises replaying the first and second events in parallel when the first value associated with the first event is different than the second value associated with the second event. 
     
     
         6 . The method of  claim 4 , wherein said replaying the first and second events on the slave database in parallel when the first and second rows are different rows with unique sets of values comprises:
 storing the first value associated with the first event in a lock table; and   determining that the first and second rows are different rows by determining that the second value associated with the second event is not included in the lock table.   
     
     
         7 . The method of  claim 6 , further comprising responding to the determination that the second value associated with the second event is not included in the lock table by adding the second value associated with the second event to the lock table. 
     
     
         8 . The method of  claim 6 , wherein the first event is a row update, and wherein identifying the first row associated with the first event includes identifying the first value before the update and identifying the second value after the update, and wherein storing the first value in the lock table comprises storing the first value and the second value in the lock table. 
     
     
         9 . The method of  claim 6 , wherein said otherwise replaying the first and second events serially comprises determining that the second value associated with the second event is included in the lock table. 
     
     
         10 . The method of  claim 9 , further comprising removing all of the values from the lock table. 
     
     
         11 . The method of  claim 1 , wherein the first and second rows are each associated with a first table of the one or more tables, and wherein identifying the first row associated with the first event further includes identifying a value of at least one unique key of the first table associated with the first event, and wherein identifying the second row associated with the second event further includes identifying a value of the least one unique key associated with the second event. 
     
     
         12 . The method of  claim 1 , wherein receiving the sequence of events comprises receiving a portion of a transaction log from a master database. 
     
     
         13 . The method of  claim 12 , further comprising:
 identifying a special event in the portion of the transaction log; and   executing the special event in isolation from the other events in the sequence of events.   
     
     
         14 . The method of  claim 13 , wherein the special event includes at least one of a table creation, a table deletion, a column creation or a column deletion. 
     
     
         15 . A non-transitory computer-readable storage medium comprising instructions that when executed perform a method of replaying transactions in a slave database, the method comprising:
 receiving a sequence of events executed on a master database, the sequence of events associated with one or more tables and at least one transaction of the master database;   identifying a first row of the one or more tables associated with a first event in the sequence;   identifying a second row of the one or more tables associated with a second event in the sequence, the second event after the first event; and   replaying the first and second events on the slave database in parallel if the first and second rows are different rows with unique sets of values, and otherwise replaying the first and second events serially.   
     
     
         16 . The computer-readable storage medium of  claim 15 , the method further comprising:
 identifying a third row associated with a third event in the sequence, the third event after the first and second events; and   replaying the first, second and third events on the slave database at least partially in parallel in a first batch if the first, second and third rows each are different rows with unique sets of values.   
     
     
         17 . A system for replaying transactions on a slave database, the system comprising:
 a slave replay module configured to receive a transaction log including a sequence of events executed on a master database, the sequence of events associated with one or more tables and at least one transaction of the master database; and   one or more computing devices operative to implement the slave replay module;   wherein the slave replay module is configured to identify a first row of the one or more tables associated with a first event in the sequence, and to identify a second row of the one or more tables associated with a second event in the sequence, the second event after the first event,   wherein the slave replay module is configured to replay the first and second events on the slave database in parallel if the first and second rows are different rows with unique sets of values and to otherwise replay the first and second events serially.   
     
     
         18 . A method of replaying transactions on a slave database, the method comprising:
 receiving a sequence of events associated with a plurality of transactions executed on a master database;   replaying the events in the sequence of events on the slave database such that the slave database is consistent with a state of the master database after execution of the sequence of events, wherein at least a portion of the events in the sequence of events are replayed in parallel; and   committing the slave database one or more times such that the atomicity of the plurality of transactions is preserved;   wherein the method is performed by one or more computing devices.   
     
     
         19 . The method of  claim 18 , wherein replaying the events in the sequence of events on the slave database comprises partitioning the events into one or more event batches based on evaluating table rows affected by the events and an order of the events in the sequence, wherein each batch includes at least one event. 
     
     
         20 . The method of  claim 19 , further comprising replaying the batches serially, including replaying the events of each batch at least partially in parallel.

Cited by (0)

No later patents cite this yet.

References (0)

No backward citations on record.