# US 11,120,047 B1 · Method and apparatus for continuously comparing two databases which are actively being kept synchronized

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 11,120,047 B1
- Document ID: US11120047B1
- Status: Granted
- Kind: B1
- Application number: 16/548,012
- Filed: 2019-08-22
- Granted: 2021-09-14
- Earliest claimed: 2018-08-22
- Assignees: Gravic, Inc.
- Applicants: Gravic, Inc.
- Inventors: John R. Hoffmann; Paul J. Holenstein; Bruce D. Holenstein; Dylan R. Holenstein
- Web page: https://patentgrep.com/patent/US11120047B1

## CPC

- G06F 16/273: {Asynchronous replication or reconciliation}
- G06F 16/275: {Synchronous replication}
- G06F 16/2358: {Change logging, detection, and notification (replication G06F16/27)}
- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

An automated method and system are provided for comparing a source database and a target database that are intended to be kept in synchronization with each other. An application processes transactions that are posted to the source database and replicated to the target database. Changes made to the source database resulting from transactions posted to the source database are collected into a first change log and then replicated to the target database. Changes made to the target database resulting from replication are collected into a second change log. The changes in the first change log are compared with representations of the changes in the second change log that correspond to the same respective changes that were made to the source database and replicated to the target database. Corrective action is performed when the comparison indicates that the representations of the changes in the first change log do not match the representations of the changes in the second change log.

## Claims

### Claim 1

An automated method for comparing a source database and a target database that are intended to be kept in synchronization with each other, wherein an application processes transactions that are posted to the source database and replicated to the target database, the method comprising:
(a) collecting changes made to the source database resulting from transactions posted to the source database into a first change log;
(b) replicating the changes made to the source database to the target database;
(c) collecting changes made to the target database resulting from step (b) into a second change log;
(d) comparing in a comparison engine representations of the changes in the first change log with representations of the changes in the second change log that correspond to the same respective changes that were made to the source database and replicated to the target database,
wherein the source database and the target database are presumed to be in synchronization with each other when the comparison indicates that the representations of the changes in the first change log are identical to the representations of the changes in the second change log, and wherein the source database and the target database are presumed not to be in synchronization with each other when the comparison indicates that the representations of the changes in the first change log are not identical to the representations of the changes in the second change log; and
(e) performing a corrective action when the comparison indicates that the representations of the changes in the first change log are not identical to the representations of the changes in the second change log.

### Claim 2 (depends on 1)

The method of claim 1 wherein the corrective action is resynchronizing the target database with the source database.

### Claim 3 (depends on 1)

The method of claim 1 wherein the corrective action is suspending or stopping the application from processing transactions.

### Claim 4 (depends on 1)

The method of claim 1 wherein the representations of the changes in the first and second change logs are hash values of their respective changes.

### Claim 5 (depends on 1)

The method of claim 1 wherein the representations of the changes in the first and second change logs are hash values of batches of their respective changes.

### Claim 6 (depends on 1)

The method of claim 1 wherein the representations of the changes in the first and second change logs represent completed steps or operations of the transactions.

### Claim 7 (depends on 1)

The method of claim 1 wherein the source and target databases include rows of data which are modified by the transactions, and wherein the representations of the changes in the first and second change logs are before and/or after images of the rows of data which were modified by the transactions.

### Claim 8 (depends on 1)

The method of claim 1 wherein the changes made to the source database are replicated to the target database from the first change log.

### Claim 9 (depends on 1)

The method of claim 1 wherein the changes made to the source database are replicated to the target database using dual writes.

### Claim 10

An automated method for comparing a first database and a second database that are intended to be kept in synchronization with each other, wherein applications process transactions that are posted to the first and second databases, and replicated to each other, the method comprising:
(a) replicating changes made to the first database to the second database, and replicating changes made to the second database to the first database;
(b) collecting changes made to the first database resulting from transactions posted to the first database or replicated from the second database into a first change log;
(c) collecting changes made to the second database resulting from transactions posted to the second database or replicated from the first database into a second change log;
(d) comparing in a comparison engine representations of the changes in the first change log with representations of the changes in the second change log that correspond to the same respective changes,
wherein the first database and the second database are presumed to be in synchronization with each other when the comparison indicates that the representations of the changes in the first change log are identical to the representations of the changes in the second change log, and wherein the first database and the second database are presumed not to be in synchronization with each other when the comparison indicates that the representations of the changes in the first change log are not identical to the representations of the changes in the second change log; and
(e) performing a corrective action when the comparison indicates that the representations of the changes in the first change log are not identical to the representations of the changes in the second change log.

### Claim 11 (depends on 10)

The method of claim 10 wherein the corrective action is resynchronizing the second database with the first database.

### Claim 12 (depends on 10)

The method of claim 10 wherein the corrective action is suspending or stopping the application from processing transactions.

### Claim 13 (depends on 10)

The method of claim 10 wherein the representations of the changes in the first and second change logs are hash values of their respective changes.

### Claim 14 (depends on 10)

The method of claim 10 wherein the representations of the changes in the first and second change logs are hash values of batches of their respective changes.

### Claim 15 (depends on 10)

The method of claim 10 wherein the representations of the changes in the first and second change logs represent completed steps or operations of the transactions.

### Claim 16 (depends on 10)

The method of claim 10 wherein the first and second databases include rows of data which are modified by the transactions, and wherein the representations of the changes in the first and second change logs are before and/or after images of the rows of data which were modified by the transactions.

### Claim 17 (depends on 10)

The method of claim 10 wherein the changes made to the first database are replicated to the second database from the first change log, and wherein the changes made to the second database are replicated to the first database from the second change log.

### Claim 18 (depends on 10)

The method of claim 10 wherein the changes made to the first database are replicated to the second database using dual writes, and the changes made to the second database are replicated to the first database using dual writes.

### Claim 19

An apparatus for comparing a source database and a target database that are intended to be kept in synchronization with each other, wherein an application processes transactions that are posted to the source database and replicated to the target database, the apparatus comprising:
(a) a replication engine configured to:
(i) collect changes made to the source database resulting from transactions posted to the source database into a first change log,
(ii) replicate the changes made to the source database to the target database, and
(iii) collect changes made to the target database resulting from the replication into a second change log;
(b) a compare configured to compare representations of the changes in the first change log with representations of the changes in the second change log that correspond to the same respective changes that were made to the source database and replicated to the target database,
wherein the source database and the target database are presumed to be in synchronization with each other when the comparison indicates that the representations of the changes in the first change log are identical to the representations of the changes in the second change log, and wherein the source database and the target database are presumed not to be in synchronization with each other when the comparison indicates that the representations of the changes in the first change log are not identical to the representations of the changes in the second change log; and
(c) a processor configured to perform a corrective action when the comparison indicates that the representations of the changes in the first change log are not identical to the representations of the changes in the second change log.

### Claim 20 (depends on 19)

The apparatus of claim 19 wherein the corrective action performed by the processor is a resynchronization of the target database with the source database.

### Claim 21 (depends on 19)

The apparatus of claim 19 wherein the corrective action performed by the processor is a suspension or stopping of the application from processing transactions.

### Claim 22 (depends on 19)

The apparatus of claim 19 wherein the representations of the changes in the first and second change logs are hash values of their respective changes.

### Claim 23 (depends on 19)

The apparatus of claim 19 wherein the representations of the changes in the first and second change logs are hash values of batches of their respective changes.

### Claim 24 (depends on 19)

The apparatus of claim 19 wherein the representations of the changes in the first and second change logs represent completed steps or operations of the transactions.

### Claim 25 (depends on 19)

The apparatus of claim 19 wherein the source and target databases include rows of data which are modified by the transactions, and wherein the representations of the changes in the first and second change logs are before and/or after images of the rows of data which were modified by the transactions.

### Claim 26 (depends on 19)

The apparatus of claim 19 wherein the changes made to the source database are replicated to the target database from the first change log.

### Claim 27 (depends on 19)

The apparatus of claim 19 wherein the changes made to the source database are replicated to the target database using dual writes.

### Claim 28

An apparatus for comparing a first database and a second database that are intended to be kept in synchronization with each other, wherein applications process transactions that are posted to the first and second databases, and replicated to each other, the apparatus comprising:
(a) a replication engine configured to:
(i) replicate changes made to the first database to the second database, and replicate changes made to the second database to the first database,
(ii) collect changes made to the first database resulting from transactions posted to the first database or replicated from the second database into a first change log, and
(iii) collect changes made to the second database resulting from transactions posted to the second database or replicated from the first database into a second change log; and
(b) a compare configured to compare representations of the changes in the first change log with representations of the changes in the second change log that correspond to the same respective changes,
wherein the first database and the second database are presumed to be in synchronization with each other when the comparison indicates that the representations of the changes in the first change log are identical to the representations of the changes in the second change log, and wherein the first database and the second database are presumed not to be in synchronization with each other when the comparison indicates that the representations of the changes in the first change log are not identical to the representations of the changes in the second change log; and
(c) a processor configured to perform a corrective action when the comparison indicates that the representations of the changes in the first change log are not identical to the representations of the changes in the second change log.

### Claim 29 (depends on 28)

The apparatus of claim 28 wherein the corrective action performed by the processor is a resynchronization of the target database with the source database.

### Claim 30 (depends on 28)

The apparatus of claim 28 wherein the corrective action performed by the processor is a suspension or stopping of the application from processing transactions.

### Claim 31 (depends on 28)

The apparatus of claim 28 wherein the representations of the changes in the first and second change logs are hash values of their respective changes.

### Claim 32 (depends on 28)

The apparatus of claim 28 wherein the representations of the changes in the first and second change logs are hash values of batches of their respective changes.

### Claim 33 (depends on 28)

The apparatus of claim 28 wherein the representations of the changes in the first and second change logs represent completed steps or operations of the transactions.

### Claim 34 (depends on 28)

The apparatus of claim 28 wherein the first and second databases include rows of data which are modified by the transactions, and wherein the representations of the changes in the first and second change logs are before and/or after images of the rows of data which were modified by the transactions.

### Claim 35 (depends on 28)

The apparatus of claim 28 wherein the changes made to the first database are replicated to the second database from the first change log, and wherein the changes made to the second database are replicated to the first database from the second change log.

### Claim 36 (depends on 28)

The apparatus of claim 28 wherein the changes made to the first database are replicated to the second database using dual writes, and the changes made to the second database are replicated to the first database using dual writes.
