# US 2022/0284033 A1 · Replicating data changes using multiple storage devices and tracking records of pending data changes stored on the storage devices

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

- Number: US 2022/0284033 A1
- Document ID: US20220284033A1
- Status: Published application
- Kind: A1
- Application number: 17/189,648
- 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; Reinhold Geiselhart; Felix Beier; Luis Eduardo Oliveira Lizardo
- Web page: https://patentgrep.com/patent/US20220284033A1

## CPC

- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F 16/113: {Details of archiving (lifecycle management in storage systems G06F3/0649; point-in-time backing up or restoration of persistent data G06F11/1446)}
- G06F 16/2282: {Tablespace storage structures; Management thereof}
- 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

Methods, computer program products, and/or systems are provided that perform the following operations: generating log files while performing data changes of a source database system table; storing the log files on a first memory device having a first access time; archiving a part of the log files from the first memory device on a second memory device having a second access time, the second access time being higher than the first access time; tracking a second number of pending data changes, the pending data changes being data changes of the records of data change of log files archived on the second memory device which are not yet replicated in a target database system table; selecting a type of data replication from a first type of data replication and a second type of data replication based on the second number; and replicating the data changes in the target database system table.

## Claims

### Claim 1

A computer-implemented method comprising:
repeatedly generating log files while performing data changes of a table of a source database system, each log file including at least one record of data change of the table of the source database system;
storing the log files on a first memory device, the first memory device having a first access time;
archiving a part of the log files being stored on the first memory device on a second memory device, the second memory device having a second access time, wherein the second access time is higher than the first access time;
tracking a second number of second pending data changes, the second pending data changes being the data changes of the records of data change of the log files being archived on the second memory device which are not yet replicated in a table of a target database system;
selecting a type of data replication from a first type of data replication and a second type of data replication based on the second number; and
replicating the data changes of the table of the source database system in the table of the target database system according to the selected type of data replication using the records of data change of the log files.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein the first type of data replication includes loading individually each of the records of data change and replicating a respective data change of a single row of the table of the source database system in the table of the target database system according to a corresponding individually loaded record of data change.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein the second type of data replication includes loading information for updating several rows of the table of the target database system together and updating the several rows of the table of the target database system based on the information.

### Claim 4 (depends on 1)

The computer-implemented method of claim 1, the method further comprising:
tracking a first number of first pending data changes, the first pending data changes being the data changes of the records of data change of the log files being stored on the first memory device which are not yet replicated in the table of the target database system; and
selecting the type of data replication based on the first number and the second number.

### Claim 5 (depends on 4)

The computer-implemented method of claim 4, wherein the selecting of the type of data replication comprises a weighting of the first number and a weighting of the second number, wherein the weighting of the first number is based on the first access time and the weighting of the second number is based on the second access time.

### Claim 6 (depends on 4)

The computer-implemented method of claim 4, the method further comprising:
selecting the first type of data replication in response to a ratio between the first number and the second number being greater than or equal to a third threshold;
wherein the ratio is a weighted ratio comprising the first number being weighted dependent on the first access time and the second number being weighted dependent on the second access time.

### Claim 7 (depends on 4)

The computer-implemented method of claim 4, the method further comprising:
selecting the second type of data replication in response to a ratio between the first number and the second number being less than a third threshold;
wherein the ratio is a weighted ratio comprising the first number being weighted dependent on the first access time and the second number being weighted dependent on the second access time.

### Claim 8 (depends on 4)

The computer-implemented method of claim 4, wherein the selecting of the type of data replication comprises:
calculating a weighted sum of the first number and the second number, the first number being weighted based on the first access time and the second number being weighted based on the second access time; and
selecting the first type of data replication if the weighted sum is less than a fourth threshold and selecting the second type of data replication if the weighted sum is greater than or equal to the fourth threshold.

### Claim 9 (depends on 4)

The computer-implemented method of claim 4, the method further comprising:
obtaining respective log numbers, wherein each respective log number is assigned to a respective one of the log files, wherein each respective log number indicates a total number of records of data change of the table of the source database system having been written until a respective moment a generating of the respective log file is started; and
tracking the first number and the second number using the respective log numbers assigned to the log files.

### Claim 10 (depends on 4)

The computer-implemented method of claim 4, wherein the log files each include a respective log number, each respective log number being assigned to a respective one of the log files, the respective log number indicating a total number of records of data change of the table of the source database system having been written until a respective moment a generating of the respective log file is started; and wherein the tracking of the first number and the second number uses the respective log numbers of the log files.

### Claim 11 (depends on 9)

The computer-implemented method of claim 9, wherein the tracking of the first number comprises calculating a difference between the respective log number assigned to the log file being stored a shortest time on the first memory device and the respective log number assigned to the log file being stored a longest time on the first memory device.

### Claim 12 (depends on 9)

The computer-implemented method of claim 9, wherein the tracking of the first number comprises calculating a difference between an actual total number of data changes of the table of the source database system at an actual instant of time and the respective log number assigned to the log file being stored a longest time on the first memory device.

### Claim 13 (depends on 9)

The computer-implemented method of claim 9, the method further comprising:
tracking a record number of a last record of data change being read out from the first memory device or the second memory device and used for a replication of a data change in the table of the target database system according to the last record of data change; and
using the record number of the last record of data change for tracking the first number or the second number.

### Claim 14 (depends on 13)

The computer-implemented method of claim 13, the method further comprising calculating the second number as a difference between the respective log number assigned to the log file being stored a longest time on the first memory device and the record number assigned to the last record of data change, wherein the last record of data change is included in one of the log files being archived on the second memory device.

### Claim 15 (depends on 13)

The computer-implemented method of claim 13, the method further comprising calculating the first number as a difference between the respective log number assigned to the log file being stored a shortest time on the first memory device and the record number assigned to the last record of data change, wherein the last record of data change is included in one of the log files being stored on the first memory device.

### Claim 16 (depends on 1)

The computer-implemented method of claim 1, the method further comprising restoring the log files, the restoring comprising storing the log files being archived on the second memory device on the first memory device.

### Claim 17 (depends on 16)

The computer-implemented method of claim 16, the method further comprising performing the restoring based on respective sizes of the records of data change of the log files being archived on the second memory device.

### Claim 18 (depends on 1)

The computer-implemented method of claim 1, the method further comprising:
counting a total number of records of data change of the table of the source database system using a counter;
determining whether the counter is in a state that is close to an overflow of the counter;
selecting the second type of data replication if the counter is in the state that is close to the overflow of the counter; and
resetting the counter after replicating the data changes of the table of the source database system in the table of the target database system according to the second type of data replication using the records of data change of the log files;
wherein the second type of data replication comprises loading all records of data change being stored on the first memory device and the second memory device together and replicating the data changes of more than one row of the table of the source database system in the table of the target database system according to all the loaded records of data change.

### Claim 19

A computer program product comprising a computer-readable storage media having computer-readable program instructions embodied therewith, the computer-readable program instructions executable by one or more processors to perform a method comprising:
repeatedly generating log files while performing data changes of a table of a source database system, each log file including at least one record of data change of the table of the source database system;
storing the log files on a first memory device, the first memory device having a first access time;
archiving a part of the log files being stored on the first memory device on a second memory device, the second memory device having a second access time, wherein the second access time is higher than the first access time;
tracking a second number of second pending data changes, the second pending data changes being the data changes of the records of data change of the log files being archived on the second memory device which are not yet replicated in a table of a target database system;
selecting a type of data replication from a first type of data replication and a second type of data replication based on the second number; and
replicating the data changes of the table of the source database system in the table of the target database system according to the selected type of data replication using the records of data change of the log files.

### Claim 20

A computer system comprising
at least one processor;
at least one computer readable storage medium;
a source database system; and
a target database system;
wherein:
the at least one processor is structured, located, connected, and programmed to run program instructions stored on the at least one computer readable storage medium; and
the stored program instructions include:
program instructions programmed to repeatedly generate log files while performing data changes of a table of the source database system, each log file comprising at least one record of data change of the table of the source database system;
program instructions programmed to store the log files on a first memory device, the first memory device having a first access time;
program instructions programmed to archive a part of the log files being stored on the first memory device on a second memory device, the second memory device having a second access time, wherein the second access time is higher than the first access time;
program instructions programmed to track a second number of second pending data changes, the second pending data changes being the data changes of the records of data change of the log files being archived on the second memory device which are not yet replicated in a table of the target database system;
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 second number; and
program instructions programmed to replicate the data changes of the table of the source database system in the table of the target database system according to the selected type of data replication using the records of data change of the log files.
