| CPC G06F 16/27 (2019.01) [G06F 16/2471 (2019.01)] | 16 Claims |

|
1. A computer-implemented method comprising:
storing, to a primary database, metadata indicative of a computer system comprising (i) the primary database, configured to connect to a secondary database, and (ii) the secondary database that replicates the primary database;
receiving, at the primary database from a requestor, a query referencing data stored to the primary database;
determining a first load of a first value on the primary database;
responsive to the first load on the primary database failing to satisfy a first offload condition, initiating, by the primary database, execution of the query;
executing, by the primary database, a first subset of the query;
determining, dynamically during execution of the query and subsequent to successfully executing the first subset of the query, a change to the first load on the primary database, wherein the first value of the first load on the primary database has changed to a second value of the first load on the primary database;
responsive to the second value of the first load satisfying the first offload condition, determining, using the metadata, that a second load on the secondary database satisfies a second offload condition;
responsive to the second load satisfying the second offload condition:
offloading, during execution of the received query, a second subset of the query to the secondary database, wherein the second subset is a nonexecuted portion of the query; and
causing the secondary database to execute the second subset of the query; and
returning results of the query to the requestor, wherein the results include a result of the first subset of the query executed by the primary database and the second subset of the query executed by the secondary database.
|