# US 2021/0240703 A1 · Selecting a host based on quality of stored data

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

- Number: US 2021/0240703 A1
- Document ID: US20210240703A1
- Status: Published application
- Kind: A1
- Application number: 16/783,078
- Filed: 2020-02-05
- Published: 2021-08-05
- Earliest claimed: 2020-02-05
- Assignees: eBay Inc.
- Applicants: eBay Inc.
- Inventors: Suresh ANAMANAMURI; Mahesh SOMANI
- Web page: https://patentgrep.com/patent/US20210240703A1

## CPC

- G06F 11/3419: {by assessing time}
- G06F 16/2453: Query optimisation
- G06F 11/3006: {where the computing system is distributed, e.g. networked systems, clusters, multiprocessor systems (multiprogramming arrangements G06F9/46; allocation of resources G06F9/50)}
- G06F 11/3034: {where the computing system component is a storage system, e.g. DASD based or network based (digital input from or digital output to record carriers G06F3/06; digital recording or reproducing G11B20/18; for distributed storage of data in networks, e.g. transport arrangements for network file system [NFS], storage area networks [SAN] or network attached storage [NAS], H04L67/1097)}
- G06F 11/3409: {for performance assessment}
- G06F 11/3495: {for systems}
- G06F 16/2471: {Distributed queries}
- G06F 11/3433: {for load management (allocation of a server based on load conditions G06F9/505; load rebalancing G06F9/5083; redistributing the load in a network by a load balancer H04L67/1029)}
- G06F 11/3452: {Performance evaluation by statistical analysis}
- G06F 2201/80: Database-specific techniques
- G06F 2201/81: Threshold
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

A database node selects one of a number of database mirror hosts to perform a database read query. In theory, mirror hosts store redundant database entries. In practice, some mirror hosts fail to receive or retain some entries, e.g. if a mirror host was down for maintenance, a mirror host was overburdened, etc. The health of a mirror host, quantified as a health score, represents a likelihood that an insert statement was received and retained. Health scores are generated based on health metrics—data periodically retrieved from mirror hosts used to infer how well the database was operating, e.g. a count of entries that were inserted, a count of errors encountered while the entries were inserted, etc. If the database read query specifies entries inserted during a specific time period, the mirror host may be selected based on the health scores representing that time period.

## Claims

### Claim 1

A computer-implemented method for determining which of a plurality of mirror hosts associated with a distributed database node to forward a database query, comprising:
forwarding database statements received by the distributed database node to the plurality of mirror hosts, wherein the forwarded database statements cause database entries to be added to the mirror hosts;
receiving health metrics from the plurality of mirror hosts, wherein a health metric includes data representing a summary of database activity caused by the forwarded database statements;
receiving a database query;
selecting a mirror host of the plurality of mirror hosts to forward the received database query based on the health metrics of the plurality of mirror hosts; and
forwarding the database query to the selected mirror host.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
generating health scores for the plurality of mirror hosts based on the received health metrics, wherein a health score indicates a likelihood that a mirror host stores a database entry associated with one of the forwarded database insert statements, and wherein a health score for one of the plurality of mirror hosts is generated by normalizing the health metrics received from the one of the plurality of mirror hosts and aggregating the normalized health metrics;
comparing health scores of the plurality of mirror hosts with a threshold health score; and
selecting one of the plurality of mirror hosts having a health score that is greater than the threshold health score.

### Claim 3 (depends on 2)

The method of claim 2, wherein the database query includes the threshold health score as a parameter.

### Claim 4 (depends on 1)

The method of claim 1, wherein health metrics comprise data representing a summary of database activity over a period of time since a previous health metric was generated, wherein the database query is for database entries that were inserted during a first period of time, and wherein the mirror host is selected based on health metrics that represent database activity during the first period of time.

### Claim 5 (depends on 1)

The method of claim 1, wherein health metrics comprise historical health metrics, and wherein historical health metrics comprise statistics about past database insert operations performed during a defined period of time.

### Claim 6 (depends on 5)

The method of claim 5, wherein historical health metrics include a count of database entries inserted during the defined period of time or a count of errors generated while attempting to insert database entries during the defined period of time.

### Claim 7 (depends on 2)

The method of claim 2, wherein selecting the target mirror host comprises selecting a mirror host of the plurality of mirror hosts with the largest health score.

### Claim 8 (depends on 2)

The method of claim 2, wherein none of the plurality of mirror hosts have a health score greater than the threshold health score for a period of time associated with the database query, the method further comprising:
identifying when, during the period of time associated with the database query, each of the plurality of mirror hosts had a health score greater than the threshold health score;
partitioning the database query into a plurality of queries addressed to two or more of the plurality of mirror hosts, wherein each of the plurality of queries retrieves data from a portion of the period of time when the corresponding mirror host had a health score greater than the threshold health score;
merging the results of the plurality of queries; and
responding to the received database query with the merged result of the plurality of queries.

### Claim 9

A computing system, comprising:
one or more processors; and
a computer-readable storage medium having computer-executable instructions stored thereupon which, when executed by the processor, cause the processor to:
forward database insert statements received by a distributed database node to a plurality of mirror hosts, wherein the forwarded database insert statements cause database entries to be added to databases on the mirror hosts;
periodically receive health metrics from the plurality of mirror hosts, wherein a health metric includes data representing a summary of database or operating system activity on a mirror host during a period of time since a previous health metric was received, including: a count of entries added to the mirror host by the forwarded database insert statements, a count of errors caused by the forwarded database insert statements, operating system log entries indicating when the mirror host was offline, or resource monitor log entries indicating when one or more hardware components of the mirror was using all available capacity;
receive a database query from a client computing device, wherein the database query includes a condition limiting results of the database query to entries inserted during a query-specified time period;
select a mirror host of the plurality of mirror hosts to receive the database query based on the received health metrics; and
forward the database query to the selected mirror host, causing the selected mirror host to retrieve entries specified by the query for delivery to the client computing device.

### Claim 10 (depends on 9)

The computing system of claim 9, wherein health metrics comprise recent health metrics, and wherein recent health metrics include statistics about read operations performed by a mirror host within a defined amount of time before having received the database query.

### Claim 11 (depends on 10)

The computing system of claim 10, wherein recent health metrics comprise a latency of query operations performed within the defined amount of time of receiving the database query.

### Claim 12 (depends on 11)

The computing system of claim 11, wherein the computer-executable instructions further cause the processor to:
generate health scores for each of the plurality of mirror hosts for the query-specified time period by normalizing the health metrics received from each mirror host that coincide with the query time period and aggregating the normalized health metrics associated with each mirror host, wherein a health score indicates a likelihood that a mirror host includes a database entry associated with one of the forwarded database insert statements, wherein two or more mirror hosts of the plurality of mirror hosts have a health score above a threshold health score, and wherein selecting the mirror host includes selecting one of the two or more mirror hosts that has a lowest average latency of query operations within the defined amount of time before receiving the database query.

### Claim 13 (depends on 9)

The computing system of claim 9, wherein operating system log entries indicating when the mirror host was offline include when an operating system running on the mirror host crashed, when a database running on the mirror host crashed, or when the mirror host was unavailable due to system maintenance.

### Claim 14 (depends on 9)

The computing system of claim 9, wherein a health score is generated for the mirror host in part by comparing the count of database entries in the mirror host to a count of entries in other mirror hosts of the plurality of mirror hosts.

### Claim 15 (depends on 9)

The computing system of claim 9, wherein the computer-executable instructions further cause the processor to:
count a number of database entries included in the forwarded database insert statements, wherein the health metric includes the count of entries added to the database on the mirror host, and wherein a health score is generated for the mirror host in part by comparing the count of entries added to the database on the mirror host to the number of database entries included in the forwarded database insert statements.

### Claim 16

A computer-readable storage medium having computer-executable instructions stored thereupon which, when executed by a processor of a computing device, cause the computing device to:
forward database insert statements received by a database node to a plurality of mirror hosts, wherein the forwarded database insert statements cause database entries to be added to the mirror hosts;
receive health metrics from the plurality of mirror hosts, wherein a health metric includes data extracted from an operating system performance monitor log on the mirror host;
receive a database query from a client computing device;
select a mirror host of the plurality of mirror hosts to receive the database query based on the received health metrics; and
forward the database query to the selected mirror host.

### Claim 17 (depends on 16)

The computer-readable storage medium of claim 16, wherein the data extracted from the operating system performance monitor log on the mirror host was added to the operating system performance monitor log since a previous health metric was generated.

### Claim 18 (depends on 16)

The computer-readable storage medium of claim 16, wherein each health metric includes data extracted from a performance monitor log including a history of processor, memory, storage, and network usage.

### Claim 19 (depends on 18)

The computer-readable storage medium of claim 18, wherein the computer-executable instructions further cause the processor to:
generate health scores for the plurality of mirror hosts based on the received health metrics, wherein a health score indicates a likelihood that a mirror host includes a database entry associated with one of the forwarded database insert statements, wherein a health score for one of the plurality of mirror hosts is generated by normalizing the health metrics received from the one of the plurality of mirror hosts and aggregating the normalized health metrics; and wherein the health score of a mirror host is lower for a period of time when the processor, memory, storage, or network usage was above a defined threshold.

### Claim 20 (depends on 16)

The computer-readable storage medium of claim 16, wherein the computer-executable instructions further cause the processor to:
generate health scores for the plurality of mirror hosts based on the received health metrics, wherein a health score indicates a likelihood that a mirror host includes a database entry associated with one of the forwarded database insert statements, wherein a health score for one of the plurality of mirror hosts is generated by normalizing the health metrics received from the one of the plurality of mirror hosts and aggregating the normalized health metrics; and wherein the normalized health metrics are selectively weighted before being aggregated to generate a health score.
