# US 2025/0156253 A1 · Database switchover in a distributed database system

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

- Number: US 2025/0156253 A1
- Document ID: US20250156253A1
- Status: Published application
- Kind: A1
- Application number: 18/507,132
- Filed: 2023-11-13
- Published: 2025-05-15
- Earliest claimed: 2023-11-13
- Assignees: International Business Machines Corporation
- Applicants: International Business Machines Corporation
- Inventors: HONG WEI SUN; Peng Hui Jiang; Yu Zhuo Sun; Xi Xue Jia; ZHI HONG LI
- Web page: https://patentgrep.com/patent/US20250156253A1

## CPC

- G06F 11/004: {Error avoidance (G06F11/07 and subgroups take precedence)}
- G06F 16/27: Replication, distribution or synchronisation of data between databases or within a distributed database system; Distributed database system architectures therefor
- G06F 11/3419: {by assessing time}
- G06F 11/3452: {Performance evaluation by statistical analysis}
- H04L 67/101: based on network conditions
- G06F 2201/80: Database-specific techniques
- G06F 2201/86: Event-based monitoring
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

A proactive switchover process in a distributed database system evaluates available resources for a plurality of database instances based on database performance metrics of the database instances and resource metrics for physical hosts of the database instances. Periodic collection and storing of the metrics dataset provide for estimating a switching time length required for switching a primary database instance candidate with the current primary database instance. Further estimating based on historic values informs the proactive switchover determination.

## Claims

### Claim 1

A computer-implemented method comprising:
evaluating available resources for a plurality of database instances including a primary database instance, the evaluating being based on a metrics dataset including database performance metrics for the plurality of database instances and resource metrics for physical hosts of the plurality of database instances, the metrics dataset collected periodically;
determining a primary database instance candidate of the plurality of database instances based on respectively corresponding available resources according to a specified period of operation;
acquiring an average response time of the primary database instance; and
responsive to a relative value of the average response time with respect to a threshold, causing the primary database instance candidate to take the role of the primary database instance.

### Claim 2 (depends on 1)

The computer-implemented method of claim 1, wherein:
the database performance metrics include at least one of: request latency, request rate, complete rate, response time, and a number of database requests for a given period; and
the resource metrics include at least one of: CPU usage, memory usage, network usage, input/output usage, and input/output latency.

### Claim 3 (depends on 1)

The computer-implemented method of claim 1, wherein the evaluating available resources includes:
calculating ranking scores respectively for the plurality of database instances.

### Claim 4 (depends on 3)

The computer-implemented method of claim 3, wherein the determining a primary database instance candidate includes:
determining the primary database instance candidate by comparing the ranking scores.

### Claim 5 (depends on 3)

The computer-implemented method of claim 3, wherein the determining the primary database instance candidate includes:
calculating a ratio of the least ranking score of the ranking scores to the ranking score for the primary database instance; and
in response to the ratio being below a predetermined threshold, designating a secondary database instance with the least ranking score as the primary database instance candidate.

### Claim 6 (depends on 1)

The computer-implemented method of claim 1, further comprising:
responsive to the average response time meeting the requirements of Quality of Service (QoS), estimating a switching time length required for switching the primary database instance candidate to the primary database instance for a next period, the estimating based on the collected database performance metrics and the resource metrics of a historic window within a previous period;
estimating a first number of requests that cannot be handled during a first window of the switching time length in the next period due to the primary database instance candidate switchover;
estimating a second number of requests that can be handled by the primary database instance candidate during a second window immediately after the next period; and
estimating a third number of requests to be received by the primary database instance during the second window immediately after the next period.

### Claim 7 (depends on 6)

The computer-implemented method of claim 6, further comprising:
in response to the third number of requests being less than the second number of requests, comparing the second number of requests with the first number of requests.

### Claim 8 (depends on 7)

The computer-implemented method of claim 7, wherein:
causing the primary database instance candidate to take the role of the primary database instance is performed responsive to:
the comparing the second number of requests with the first number of requests; and
the difference between the second number and the first number exceeding a predetermined threshold; and
the primary database instance candidate takes the role of the primary database instance during the second window.

### Claim 9 (depends on 1)

The computer-implemented method of claim 1, further comprising:
collecting, for the specified period, the database performance metrics for the plurality of database instances; and
collecting, for the specified period, the resource metrics for physical hosts of the plurality of database instances.

### Claim 10

A computer system comprising:
a processor set; and
a computer readable storage medium having program instructions stored therein;
wherein:
the processor set executes the program instructions that cause the processor set to perform a method comprising:
evaluating available resources for a plurality of database instances including a primary database instance, the evaluating being based on a metrics dataset including database performance metrics for the plurality of database instances and resource metrics for physical hosts of the plurality of database instances, the metrics dataset collected periodically;
determining a primary database instance candidate of the plurality of database instances based on respectively corresponding available resources according to a specified period of operation;
acquiring an average response time of the primary database instance; and
responsive to a relative value of the average response time with respect to a threshold, causing the primary database instance candidate to take the role of the primary database instance.

### Claim 11 (depends on 10)

The computer system of claim 10, wherein the evaluating available resources includes: calculating ranking scores respectively for the plurality of database instances.

### Claim 12 (depends on 11)

The computer system of claim 11, wherein the determining the primary database instance candidate includes:
calculating a ratio of the least ranking score of the ranking scores to the ranking score for the primary database instance; and
in response to the ratio being below a predetermined threshold, designating a secondary database instance with the least ranking score as the primary database instance candidate.

### Claim 13 (depends on 10)

The computer system of claim 10, further causing the processor set to perform a method comprising:
responsive to the average response time meeting the requirements of Quality of Service (QoS), estimating a switching time length required for switching the primary database instance candidate to the primary database instance for a next period, the estimating based on the collected database performance metrics and the resource metrics of a historic window within a previous period;
estimating a first number of requests that cannot be handled during a first window of the switching time length in the next period due to the primary database instance candidate switchover;
estimating a second number of requests that can be handled by the primary database instance candidate during a second window immediately after the next period; and
estimating a third number of requests to be received by the primary database instance during the second window immediately after the next period.

### Claim 14 (depends on 13)

The computer system of claim 13, further causing the processor set to perform a method comprising:
in response to the third number of requests being less than the second number of requests, comparing the second number of requests with the first number of requests.

### Claim 15 (depends on 14)

The computer system of claim 14, wherein:
causing the primary database instance candidate to take the role of the primary database instance is performed responsive to:
the comparing the second number of requests with the first number of requests; and
the difference between the second number and the first number exceeding a predetermined threshold; and
the primary database instance candidate takes the role of the primary database instance during the second window.

### Claim 16

A computer program product comprising:
a computer-readable storage medium having a set of instructions stored therein which, when executed by a processor, causes the processor to perform a method comprising:
collecting database performance metrics for a plurality of database instances of a database cluster and resource metrics for each physical machine hosting each of the plurality of database instances within a time interval, wherein the plurality of database instances consists of a primary database instance and at least one secondary database instance;
evaluating available resources for each of the plurality of database instances based on the database performance metrics and the resource metrics;
determining a primary database instance candidate from the at least one secondary database instance based on the available resources for each of the plurality of database instances;
acquiring average response time of the primary database instance; and
in response to the average response time not meeting requirements of Quality of Service (QOS), using the primary database instance candidate to take the role of the primary database instance.

### Claim 17 (depends on 16)

The computer program product of claim 16, wherein the evaluating available resources includes:
calculating ranking scores respectively for the plurality of database instances.

### Claim 18 (depends on 17)

The computer program product of claim 17, wherein the determining the primary database instance candidate includes:
calculating a ratio of the least ranking score of the ranking scores to the ranking score for the primary database instance; and
in response to the ratio being below a predetermined threshold, designating a secondary database instance with the least ranking score as the primary database instance candidate.

### Claim 19 (depends on 16)

The computer program product of claim 16, further causing the processor set to perform a method comprising:
responsive to the average response time meeting the requirements of Quality of Service (QoS), estimating a switching time length required for switching the primary database instance candidate to the primary database instance for a next period, the estimating based on the collected database performance metrics and the resource metrics of a historic window within a previous period;
estimating a first number of requests that cannot be handled during a first window of the switching time length in the next period due to the primary database instance candidate switchover;
estimating a second number of requests that can be handled by the primary database instance candidate during a second window immediately after the next period; and
estimating a third number of requests to be received by the primary database instance during the second window immediately after the next period.

### Claim 20 (depends on 16)

The computer program product of claim 16, further causing the processor set to perform a method comprising:
in response to the third number of requests being less than the second number of requests, comparing the second number of requests with the first number of requests;
wherein:
causing the primary database instance candidate to take the role of the primary database instance is performed responsive to:
the comparing the second number of requests with the first number of requests; and
the difference between the second number and the first number exceeding a predetermined threshold; and
the primary database instance candidate takes the role of the primary database instance during the second window.
