Patent ID: 9594653
Date: 2017-03-14
CPC Classifications: G06F

Claim:
1. A computer-implemented method for automating local database connection affinity and failover in a database cluster, the method comprising: receiving, by a first compute node of a plurality of compute nodes of the database cluster and from a client application, a request for data associated with a particular database transaction, the plurality of compute nodes sharing at least a portion of the data, the client application is located within the first compute node, wherein the client application is a Java application; determining, by the first compute node, that network latency is detrimental to an overall performance of the database cluster; in response to the determining, establishing, without regard to whether another compute node of the plurality of compute nodes has a lighter workload than the first compute node, a first connection between the client application and a first database of the database cluster, the first connection being a local connection, wherein the first database is located within the first compute node and the client application accesses the first database via shared memory, and wherein a Java Database Connectivity (JDBC) device driver located within the first compute node performs the establishing of the first connection, the JDBC device driver enables the client application to interact with the database cluster; detecting, by the first compute node, that a failure associated with the first database has occurred; in response to the detecting of the failure, determining, by the JDBC device driver, that a second compute node has a most available workload capacity to service the request among the plurality of compute nodes, wherein the JDBC device driver includes a list that comprises calculations indicating a workload capacity of each of the plurality of compute nodes of the database cluster; and in response to the determining that the second compute node has a most available workload capacity, executing, by the JDBC device driver, a failover operation to continue servicing the request for the data, the executing a failover operation including establishing a second connection between the client application and a second database of the database cluster, the second database including the data, the second connection being a Transmission Control Protocol/Internet Protocol (TCP/IP) connection, wherein the second database is remote to the first compute node and the second database is within a second compute node.