US 12,141,162 B1
Database connection manager, metric-based routing and load balancing for replica servers
Jamie Plenderleith, Dublin (IE)
Assigned to Amazon Technologies, Inc., Seattle, WA (US)
Filed by Amazon Technologies, Inc., Seattle, WA (US)
Filed on Feb. 6, 2018, as Appl. No. 15/890,125.
Int. Cl. G06F 16/27 (2019.01); G06F 11/30 (2006.01); G06F 11/34 (2006.01); G06F 16/951 (2019.01)
CPC G06F 16/27 (2019.01) [G06F 11/3006 (2013.01); G06F 11/3433 (2013.01); G06F 16/951 (2019.01)] 19 Claims
OG exemplary drawing
 
1. A system, comprising:
a plurality of database servers that stores replicated data of a database on respective persistent storage devices; and
a connection manager configured to:
establish respective database connections to the plurality of database servers;
establish a database connection from a database client to the connection manager;
receive a plurality of database query statements from the database client on the database connection to the database client;
select, for individual ones of the database query statements, one of the database connections to send an individual database query statement to a selected one of the database servers, wherein the individual database query statement belongs to a classification of database query statements assigned to the selected database server, and the selected database server is selected to process the individual database query statement based at least in part on one or more health or performance metrics of the selected database server including an amount of read or write traffic that originated the selected database server to a persistent storage device;
in response to determining that no database server is available to process a particular one of the database query statements of a particular classification, add the particular database query statement to a queue of database statements at the connection manager, wherein the particular database query statement is dequeued when the connection manager determines that at least one database server assigned to process the particular classification of the particular database query statement has become available; and
after a determination of an overflow of the queue of database statements wherein the queue reaches a capacity, deny further database query statements of the particular classification received from the database client over the database connection and issue one or more busy errors or throttle exceptions to one or more database clients associated with the further database query statements.