# US 2024/0202182 A1 · Data replication in active-active databases

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

- Number: US 2024/0202182 A1
- Document ID: US20240202182A1
- Status: Published application
- Kind: A1
- Application number: 18/065,722
- Filed: 2022-12-14
- Published: 2024-06-20
- Earliest claimed: 2022-12-14
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Guang Han Sui; Peng Hui Jiang; Fan Jing Meng; Mai Zeng; Jun Su; Jia Tian Zhong
- Web page: https://patentgrep.com/patent/US20240202182A1

## CPC

- G06F 16/2365: {Ensuring data consistency and integrity}
- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F 16/273: {Asynchronous replication or reconciliation}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A method of managing an active-active database system storing a first copy of data records at a first node a second copy of the data records at a second node includes receiving a first set of operations stored at the first node as a first set of local operations, a copy of the first set of operations transmitted to the second node and stored as a first set of remote operations, and receiving a second set of operations stored at the second node as a second set of local operations, a copy of the second set of operations transmitted to the first node and stored as a second set of remote operations. The method includes determining a comparison point by selecting an operation from each of the first set of operations and the second set of operations, and comparing the first copy of the data records to the second copy.

## Claims

### Claim 1

A method of managing an active-active database system, the method comprising:
accessing the database system by a processing device, the database system storing a collection of data records, wherein the database system stores a first copy of the data records at a first node, and a second copy of the data records at a second node;
receiving a first set of operations at the first node, the first set of operations stored at the first node as a first set of local operations, a copy of the first set of operations transmitted to the second node and stored as a first set of remote operations;
receiving a second set of operations at the second node, the second set of operations stored at the second node as a second set of local operations, a copy of the second set of operations transmitted to the first node and stored as a second set of remote operations;
determining a comparison point by selecting an operation from each of the first set of operations and the second set of operations;
comparing the first copy of the data records to the second copy of the data records, wherein the comparing includes;
comparing values of data records of the first copy that are not changed by operations subsequent to the comparison point, to values of data records of the second copy that are not changed by operations subsequent to the comparison point;
comparing old data values of data records of the first copy that are updated by one or more subsequent operations, to old data values of data records of the second copy that are updated by one or more subsequent operations;
comparing operations occurring after the comparison point; and
determining whether the first and second nodes are consistent based on the comparing.

### Claim 2 (depends on 1)

The method of claim 1, wherein the processing device includes a first comparison module stored locally with the first copy and a second comparison module stored locally with the second copy.

### Claim 3 (depends on 2)

The method of claim 2, wherein the first comparison module negotiates with the second comparison module to select the comparison point based on a sequence of the first set of operations and a sequence of the second operations.

### Claim 4 (depends on 3)

The method of claim 3, wherein the first module negotiates with the second module to provide sufficient time to prepare the first module and the second module to perform a comparison.

### Claim 5 (depends on 2)

The method of claim 2, transmit all subsequent operations occurring after the selected operations from the second node to the first node, and manage the order of execution of each of the subsequent operations by the first module.

### Claim 6 (depends on 1)

The method of claim 1, further comprising logging the old data values of data records of the first copy that are updated by the one or more subsequent operations, and logging the old data values of data records of the second copy that are updated by one or more subsequent operations.

### Claim 7 (depends on 1)

The method of claim 1, further comprising adding a flag to each data record of the first copy and the second copy that is updated by the one or more subsequent operations.

### Claim 8 (depends on 1)

The method of claim 1, wherein the first comparison and the second comparison are performed independently.

### Claim 9

A system for managing an active-active database system, the system comprising:
a processor communicatively coupled to a memory, the processor configured to perform:
accessing the database system by a processing device, the database system storing a collection of data records, wherein the database system stores a first copy of the data records at a first node, and a second copy of the data records at a second node;
receiving a first set of operations at the first node, the first set of operations stored at the first node as a first set of local operations, a copy of the first set of operations transmitted to the second node and stored as a first set of remote operations;
receiving a second set of operations at the second node, the second set of operations stored at the second node as a second set of local operations, a copy of the second set of operations transmitted to the first node and stored as a second set of remote operations;
determining a comparison point by selecting an operation from each of the first set of operations and the second set of operations;
comparing the first copy of the data records to the second copy of the data records, wherein the comparing includes:
comparing values of data records of the first copy that are not changed by operations subsequent to the comparison point, to values of data records of the second copy that are not changed by operations subsequent to the comparison point;
comparing old data values of data records of the first copy that are updated by one or more subsequent operations, to old data values of data records of the second copy that are updated by one or more subsequent operations;
comparing operations occurring after the comparison point; and
determining whether the first and second nodes are consistent based on the comparing.

### Claim 10 (depends on 9)

The system of claim 9, wherein the processing device includes a first comparison module stored locally with the first copy and a second comparison module stored locally with the second copy.

### Claim 11 (depends on 10)

The system of claim 10, wherein the first comparison module negotiates with the second comparison module to select the comparison point based on a sequence of the first set of operations and a sequence of the second operations.

### Claim 12 (depends on 11)

The system of claim 11, wherein the first module negotiates with the second module to provide sufficient time to prepare the first module and the second module to perform a comparison.

### Claim 13 (depends on 10)

The system of claim 10, transmit all subsequent operations occurring after the selected operations from the second node to the first node, and manage the order of execution of each of the subsequent operations by the first module.

### Claim 14 (depends on 9)

The system of claim 9, wherein the processing is configured to further perform:
logging the old data values of data records of the first copy that are updated by the one or more subsequent operations, and logging the old data values of data records of the second copy that are updated by one or more subsequent operations.

### Claim 15

A computer program product for managing an active-active database, comprising a computer readable storage medium having program instructions embodied therewith, the program instructions executable by a processor to cause the processor to perform a method comprising:
accessing the database system by a processing device, the database system storing a collection of data records, wherein the database system stores a first copy of the data records at a first node, and a second copy of the data records at a second node;
receiving a first set of operations at the first node, the first set of operations stored at the first node as a first set of local operations, a copy of the first set of operations transmitted to the second node and stored as a first set of remote operations;
receiving a second set of operations at the second node, the second set of operations stored at the second node as a second set of local operations, a copy of the second set of operations transmitted to the first node and stored as a second set of remote operations;
determining a comparison point by selecting an operation from each of the first set of operations and the second set of operations;
comparing the first copy of the data records to the second copy of the data records, wherein the comparing includes:
comparing values of data records of the first copy that are not changed by operations subsequent to the comparison point, to values of data records of the second copy that are not changed by operations subsequent to the comparison point;
comparing old data values of data records of the first copy that are updated by one or more subsequent operations, to old data values of data records of the second copy that are updated by one or more subsequent operations;
comparing operations occurring after the comparison point; and
determining whether the first and second nodes are consistent based on the comparing.

### Claim 16 (depends on 15)

The computer program product of claim 15, wherein the processing device includes a first comparison module stored locally with the first copy and a second comparison module stored locally with the second copy.

### Claim 17 (depends on 16)

The computer program product of claim 16, wherein the first comparison module negotiates with the second comparison module to select the comparison point based on a sequence of the first set of operations and a sequence of the second operations.

### Claim 18 (depends on 17)

The computer program product of claim 17, wherein the first module negotiates with the second module to provide sufficient time to prepare the first module and the second module to perform a comparison.

### Claim 19 (depends on 16)

The computer program product of claim 16, transmit all subsequent operations occurring after the selected operations from the second node to the first node, and manage the order of execution of each of the subsequent operations by the first module.

### Claim 20 (depends on 15)

The computer program product of claim 15, wherein the method further includes logging the old data values of data records of the first copy that are updated by the one or more subsequent operations, and logging the old data values of data records of the second copy that are updated by one or more subsequent operations.
