Method and system for transparent database connection pooling and query queuing
First Claim
1. Database accelerator apparatus, for use in a network having a set of at least one client system each running an application which makes database queries via a network to a particular IP address and port combination, and a set of at least one database server each having access to at least a portion of a database,the accelerator apparatus being arranged to:
- receive, through a network port, a database query made by the set of client systems and directed to the particular IP address and port combination, the received database query including database query text;
determine, by reference to data objects describing a plurality of pre-existing open connections from the accelerator apparatus to the database servers, whether one of the connections is available for the query, and if so, then forward the query through the available connection toward the set of database servers, wherein the data objects are allocated among a plurality of connection pools including at least one data object allocated to a first connection pool and at least one data object allocated to a second connection pool, all of the connections in the first connection pool being to servers designated to handle read queries only, and all of the connections in the second connection pool being to servers designated to handle write queries, and at least one of the connections in the second connection pool being to a server also designated to handle read queries; and
select a preferred pool and a less-preferred pool of the connection pools in dependence upon whether the received query is a read query,wherein the preferred pool selected by the apparatus if the received query is a read query, is the first connection pool, and wherein the less-preferred pool selected by the apparatus if the received database query is a read query, is the second connection pool,and wherein the determination of whether one of the connections is available for the query consists of a first sub-determination of whether a connection in the preferred pool is available for the query, and if a connection in the preferred pool is not available for the query then a second sub-determination of whether a connection in the less-preferred pool is available for the query.
6 Assignments
0 Petitions
Accused Products
Abstract
Roughly described, a database accelerator is installed transparently in a network between database client and server systems. It maintains a pool of connections to the database server(s) for re-use as needed. Connection requests from client systems are received and completed by the accelerator, and queries received on such client-side connections are forwarded through pool connections toward the database servers. If no appropriate connections are available when needed for a particular query, the accelerator forms one by emulating a client system requesting a connection to the desired database server. If the maximum number of connections has already been reached, then the query is queued until a connection becomes available in the pool. By installing the accelerator transparently in the network, no modifications are required to the software in either the client systems or the database servers to add connection pooling functionality to an existing client/server database environment.
-
Citations
13 Claims
-
1. Database accelerator apparatus, for use in a network having a set of at least one client system each running an application which makes database queries via a network to a particular IP address and port combination, and a set of at least one database server each having access to at least a portion of a database,
the accelerator apparatus being arranged to: -
receive, through a network port, a database query made by the set of client systems and directed to the particular IP address and port combination, the received database query including database query text; determine, by reference to data objects describing a plurality of pre-existing open connections from the accelerator apparatus to the database servers, whether one of the connections is available for the query, and if so, then forward the query through the available connection toward the set of database servers, wherein the data objects are allocated among a plurality of connection pools including at least one data object allocated to a first connection pool and at least one data object allocated to a second connection pool, all of the connections in the first connection pool being to servers designated to handle read queries only, and all of the connections in the second connection pool being to servers designated to handle write queries, and at least one of the connections in the second connection pool being to a server also designated to handle read queries; and select a preferred pool and a less-preferred pool of the connection pools in dependence upon whether the received query is a read query, wherein the preferred pool selected by the apparatus if the received query is a read query, is the first connection pool, and wherein the less-preferred pool selected by the apparatus if the received database query is a read query, is the second connection pool, and wherein the determination of whether one of the connections is available for the query consists of a first sub-determination of whether a connection in the preferred pool is available for the query, and if a connection in the preferred pool is not available for the query then a second sub-determination of whether a connection in the less-preferred pool is available for the query. - View Dependent Claims (2, 3, 4, 5, 6, 7)
-
-
8. A query routing method, for use in a network having a set of at least one client system each running an application which makes database queries via a network to a particular IP address and port combination, and a plurality of database servers each having access to at least a portion of a database, comprising the steps of a database accelerator:
-
receiving, through a network port, a database query made by the set of client systems and directed to the particular IP address and port combination; determining, by reference to data objects describing a plurality of pre-existing open connections from the accelerator to the database servers, whether one of the connections is available for the query, and if so, then forwarding the query through the available connection toward the set of database servers, wherein the data objects are allocated among a plurality of connection pools including at least one data object allocated to a first connection pool and at least one data object allocated to a second connection pool, all of the connections in the first connection pool being to servers designated to handle read queries only, and all of the connections in the second connection pool being to servers designated to handle write queries, and at least one of the connections in the second connection pool being to a server also designated to handle read queries; and selecting a preferred pool and a less-preferred pool of the connection pools in dependence upon whether the received query is a read query, wherein the preferred pool selected by the database accelerator if the received query is a read query is the first connection pool, and the less-preferred pool selected by the database accelerator if the received database query is a read query is the second connection pool, and wherein determining whether one of the connections is available for the query consists of a sub-step of determining whether a connection in the preferred pool is available for the query, and if a connection in the preferred pool is not available for the query then a sub-step of determining whether a connection in the less-preferred pool is available for the query.
-
-
9. Database accelerator apparatus, for use in a network having a set of at least one client system each running an application which makes database queries via a network to a particular IP address and port combination, and a set of at least one database server each having access to at least a portion of a database, the accelerator apparatus comprising:
-
a network port through which the accelerator apparatus receives queries directed to the particular IP address and port combination; a network port through which the accelerator apparatus forwards queries to one or more of the database servers; and a memory containing metadata for each of a plurality of authenticated open connections from the accelerator apparatus to the database servers, the metadata for each of the connections in the plurality indicating; one of the database servers to which the connection is established; and whether the connection is or is not currently in use, wherein a first subset of at least one of the database servers is designated to handle read queries only and a second subset of at least one of the database servers is designated to handle write queries, wherein the connections in the plurality of authenticated connections are divided into a plurality of connection pools, wherein all of the connections in a first one of the connection pools are to servers in the first subset of servers, and all of the connections in a second one of the connection pools are to servers in the second subset of servers. - View Dependent Claims (10, 11, 12, 13)
-
Specification