# US 2022/0284034 A1 · Replicating data changes of a source database in a target database using data change records and runtime statistics of the source database

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

- Number: US 2022/0284034 A1
- Document ID: US20220284034A1
- Status: Published application
- Kind: A1
- Application number: 17/189,671
- Filed: 2021-03-02
- Published: 2022-09-08
- Earliest claimed: 2021-03-02
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: Knut Stolze; Felix Beier; Reinhold Geiselhart; Luis Eduardo Oliveira Lizardo
- Web page: https://patentgrep.com/patent/US20220284034A1

## CPC

- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F 11/3428: {Benchmarking}
- G06F 11/3452: {Performance evaluation by statistical analysis}
- G06F 11/3476: {Data logging (G06F11/14, G06F11/2205 take precedence)}
- G06F 16/2379: {Updates performed during online database operations; commit processing}
- G06F 11/302: {where the computing system component is a software system}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

The present disclosure relates to a computer implemented method for replicating data changes of a source table in a target table. Methods, computer program products, and/or systems are provided that perform the following operations: loading first runtime statistics about processing the data changes of the source table at a first point of time; repeatedly generating data change records while performing the data changes of the source table, the data change records comprising information about the data changes of the source table; storing the data change records on a storage device; loading second runtime statistics about processing the data changes of the source table at a second point of time; and selecting a type of data replication from a first type of data replication and a second type of data replication depending on the first runtime statistics and the second runtime statistics.

## Claims

### Claim 1

A computer implemented method comprising:
loading first runtime statistics about processing data changes of a source table at a first point of time;
repeatedly generating data change records while performing the data changes of the source table, the data change records comprising information about the data changes of the source table;
storing the data change records on a storage device;
loading second runtime statistics about processing the data changes of the source table at a second point of time; and
selecting a type of data replication from a first type of data replication and a second type of data replication based on the first runtime statistics and the second runtime statistics;
wherein the first type of data replication includes loading the data change records from the storage device and replicating respective data changes of the source table in a target table according to respective loaded data change records; and
wherein the second type of data replication includes loading information about data values of several rows of the source table and updating several rows of the target table based on the information about the data values of the several rows of the source table.

### Claim 2 (depends on 1)

The computer implemented method of claim 1, wherein the loading of the information about the data values of several rows of the source table comprises loading all data values of the source table from a source database system.

### Claim 3 (depends on 1)

The computer implemented method of claim 1, wherein the loading of the first runtime statistics comprises a loading of information about a first total number of data changes of the source table at the first point of time; and the loading of the second runtime statistics comprising a loading of information about a second total number of the data changes of the source table at the second point of time;
wherein the method further comprises selecting the type of data replication based on the information about the first total number of the data changes and the information about the second total number of the data changes.

### Claim 4 (depends on 3)

The computer implemented method of claim 3, the method further comprising:
replicating a first number of the data changes of the source table in the target table according to the data change records on the storage device and according to the first type of data replication between the first point of time and the second point of time;
determining a number of pending data changes of the target table based on the first number, the first total number of data changes, and the second total number of data changes; and
selecting the type of data replication from the first type of data replication and the second type of data replication based on the number of the pending data changes of the target table.

### Claim 5 (depends on 4)

The computer implemented method of claim 4, wherein the second type of data replication is selected and the loading of the information about the data values of the several rows of the source table comprises loading all data values of the source table, and wherein the method further comprises:
resetting a counter for counting a first number of data changes;
loading of the information about the first total number of the data changes of the source table at the first point of time, with the first total number being an updated first total number and with the first point of time being an updated first point of time;
repeatedly generating of the data change records while performing the data changes of the source table, with the data change records being updated data change records;
storing of the data change records on the storage device;
replicating of the first number of the data changes of the source table in the target table according to the data change records on the storage device and according to the first type of data replication between the first point of time and the second point of time, the first number of the data changes being an updated first number of the data changes, the data change records on the storage device being updated data change records on the storage device, the second point of time being an updated second point of time;
loading of the information about the second total number of the data changes of the source table at the second point of time, with the second total number being an updated second total number;
determining of the number of the pending data changes of the target table based on the first number of the data changes, the first total number of the data changes and the second total number of the data changes, the number of the pending data changed being an updated number of the pending data changes; and
selecting of the type of data replication from the first type of data replication and the second type of data replication depending on the number of the pending data changes of the target table.

### Claim 6 (depends on 4)

The computer implemented method of claim 4, wherein the first type of data replication is selected, and wherein the method further comprises:
resetting a counter for counting the first number of data changes;
replacing the information about the first total number of the data changes with the information about the second total number of the data changes;
repeatedly generating of the data change records while performing the data changes of the source table, with the data change records being updated data change records;
storing of the data change records on the storage device;
replicating of the first number of the data changes of the source table in the target table according to the data change records on the storage device and according to the first type of data replication between the first point of time and the second point of time, the first number of the data changes being an updated first number of the data changes, the data change records on the storage device being updated data change records on the storage device, the second point of time being an updated second point of time;
loading of the information about the second total number of the data changes of the source table at the second point of time, with the second total number being an updated second total number;
determining of the number of the pending data changes of the target table based on the first number of the data changes, the first total number of the data changes and the second total number of the data changes, the number of the pending data changed being an updated number of the pending data changes; and
selecting of the type of data replication from the first type of data replication and the second type of data replication depending on the number of the pending data changes of the target table.

### Claim 7 (depends on 4)

The computer implemented method of claim 4, the method further comprising selecting the second type of data replication if the number of the pending data changes of the target table is greater than a first threshold.

### Claim 8 (depends on 7)

The computer implemented method of claim 7, the method further comprising determining the first threshold such that a length of a first period of time for performing the number of the pending data changes of the target table according to the first type of data replication is approximately equal to a length of a second period of time for copying all data values of the source table to the target table.

### Claim 9 (depends on 8)

The computer implemented method of claim 8, the method further comprising determining the first threshold based an access time of the storage device.

### Claim 10 (depends on 8)

The computer implemented method of claim 8, the method further comprising determining the first threshold based an access time of a target database system, the target table being stored on the target database system.

### Claim 11 (depends on 3)

The computer implemented method of claim 3, the method further comprising selecting the type of data replication from the first type of data replication and the second type of data replication based on a difference between the second total number and the first total number.

### Claim 12 (depends on 3)

The computer implemented method of claim 3, the method further comprising selecting the type of data replication from the first type of data replication and the second type of data replication based on a difference between the second total number and the first total number and a number of pending queries on a source database system.

### Claim 13 (depends on 3)

The computer implemented method of claim 3, the method further comprising selecting the type of data replication from the first type of data replication and the second type of data replication based on a rate of data changes per time of the source table, the rate of data changes per time being dependent on a difference between the first total number and the second total number and a length of a time interval between the first point of time and the second point of time.

### Claim 14 (depends on 1)

The computer implemented method of claim 1, wherein the loading of the information about the data values of several rows of the source table comprises loading the data values of several rows of the source table from the source database system, the several rows being a subset of all rows of the source table.

### Claim 15

A computer program product comprising one or more computer-readable storage media, and program instructions collectively stored on the one or more computer-readable storage media, the program instructions executable by one or more processors to perform a method comprising:
loading first runtime statistics about processing data changes of a source table at a first point of time;
repeatedly generating data change records while performing the data changes of the source table, the data change records comprising information about the data changes of the source table;
storing the data change records on a storage device;
loading second runtime statistics about processing the data changes of the source table at a second point of time; and
selecting a type of data replication from a first type of data replication and a second type of data replication based on the first runtime statistics and the second runtime statistics;
wherein the first type of data replication includes loading the data change records from the storage device and replicating respective data changes of the source table in a target table according to respective loaded data change records; and
wherein the second type of data replication includes loading information about data values of several rows of the source table and updating several rows of the target table based on the information about the data values of the several rows of the source table.

### Claim 16 (depends on 15)

The computer program product of claim 15, wherein the loading of the first runtime statistics comprises a loading of information about a first total number of data changes of the source table at the first point of time, wherein the loading of the second runtime statistics comprising a loading of information about a second total number of data changes of the source table at the second point of time;
wherein the method further comprises selecting the type of data replication based on the information about the first total number of the data changes and the information about the second total number of the data changes.

### Claim 17 (depends on 16)

The computer program product of claim 16, the method further comprising:
replicating a first number of the data changes of the source table in the target table according to the data change records on the storage device and according to the first type of data replication between the first point of time and the second point of time;
determining a number of pending data changes of the target table based on the first number, the first total number of data changes, and the second total number of data changes; and
selecting the type of data replication from the first type of data replication and the second type of data replication based on the number of the pending data changes of the target table.

### Claim 18

A computer system comprising:
a processor set; and
a computer readable storage medium;
wherein:
the processor set is structured, located, connected, and programmed to run program instructions stored on the computer readable storage medium; and
the stored program instructions include:
program instructions programmed to load first runtime statistics about processing data changes of a source table at a first point of time;
program instructions programmed to repeatedly generate data change records while performing the data changes of the source table, the data change records comprising information about the data changes of the source table;
program instructions programmed to store the data change records on a storage device;
program instructions programmed to load second runtime statistics about processing the data changes of the source table at a second point of time; and
program instructions programmed to select a type of data replication from a first type of data replication and a second type of data replication based on the first runtime statistics and the second runtime statistics;
wherein the first type of data replication includes loading the data change records from the storage device and replicating respective data changes of the source table in a target table according to respective loaded data change records; and
wherein the second type of data replication includes loading information about data values of several rows of the source table and updating several rows of the target table based on the information about the data values of the several rows of the source table.

### Claim 19 (depends on 18)

The computer system of claim 18, wherein the loading of the first runtime statistics comprises a loading of information about a first total number of data changes of the source table at the first point of time, wherein the loading of the second runtime statistics comprises a loading of information about a second total number of data changes of the source table at the second point of time;
wherein the stored program instructions further include program instructions programmed to select the type of data replication based on the information about the first total number of data changes and the information about the second total number of data changes.

### Claim 20 (depends on 19)

The computer system of claim 19, wherein the stored program instructions further include:
program instructions programmed to replicate a first number of data changes of the source table in the target table according to the data change records on the storage device and according to the first type of data replication between the first point of time and the second point of time;
program instructions programmed to determine a number of pending data changes of the target table based on the first number, the first total number of data changes, and the second total number of data changes; and
program instructions programmed to select the type of data replication from the first type of data replication and the second type of data replication based on the number of pending data changes of the target table.
