# US 2018/0025053 A1 · Systems and methods for load balancing and connection multiplexing among database servers

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

- Number: US 2018/0025053 A1
- Document ID: US20180025053A1
- Status: Published application
- Kind: A1
- Application number: 15/722,767
- Filed: 2017-10-02
- Published: 2018-01-25
- Earliest claimed: 2014-07-24
- Assignees: Citrix Systems, Inc.
- Applicants: Citrix Systems, Inc.
- Inventors: Sudish Kumar Sah; Rajesh Joshi
- Web page: https://patentgrep.com/patent/US20180025053A1

## CPC

- G06F 16/2453: Query optimisation
- H04L 67/1014: based on the content of a request
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- H04L: TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION (arrangements common to telegraphic and telephonic communication H04M)

## Abstract

The present invention is related to a method for load balancing and connection multiplexing structured query language (SQL) queries among a plurality of database servers. A device intermediary to a plurality of clients and a plurality of database servers receives an SQL query to access a database provided by the plurality of database servers from a client via a first connection established between the device and the client. The device identifies for the SQL query a policy for selecting among the plurality of servers. The policy includes an expression to identify predetermined data from content of the SQL query. The device may select a server from the plurality of servers based on applying the expression of the policy to content of the SQL query and forward the SQL query to the selected server via a second connection established between the device and the selected server.

## Claims

### Claim 1

A system comprising:
a device comprising one or more processors, coupled to memory, and intermediary to a plurality of clients and a plurality of servers, the plurality of servers providing access to a database;
a policy for selecting a server among the plurality of servers, the policy comprising an expression to identify content in structured query language (SQL) queries;
wherein the device is configured to:
identify the policy for a SQL query received from a client of the plurality of clients to access the database;
select a server from the plurality of servers based on applying the expression of the policy to content of the SQL query;
modify the SQL query to replace a first cursor identifier of the SQL query with a second cursor identifier identified from a cursor map, the second cursor identifier comprising a server identifier for the selected server. the cursor map updated with the second cursor identifier associated with the first cursor identifier; and
forward the SQL query to the selected server.

### Claim 2 (depends on 1)

The system of claim 1, wherein the device is further configured to receive the SQL query via a first connection established between the device and the client.

### Claim 3 (depends on 1)

The system of claim 1, wherein the device is further configured to forward the SQL query via a second connection established between the device and the server.

### Claim 4 (depends on 1)

The system of claim 1, wherein the SQL query comprises a write request to the database and device is further configured apply the expression of the policy to identify that content of the SQL query has a command to write to the database.

### Claim 5 (depends on 4)

The system of claim 4, where the device is further configured to select the server based at least on the SQL query having the command to write to the database.

### Claim 6 (depends on 1)

The system of claim 1, wherein the SQL query comprises a read request to the database and device is further configured apply the expression of the policy to identify that content of the SQL query has a command to read from the database.

### Claim 7 (depends on 6)

The system of claim 6, where the device is further configured to select the server based at least on the SQL query having the command to read from the database.

### Claim 8 (depends on 1)

The system of claim 1, wherein the device is further configured to select the server based at least on a property of a connection between the device and one of the client or the server.

### Claim 9 (depends on 1)

The system of claim 1, wherein the policy comprises the expression to identify one of the following content of the SQL query: client user name, client database, and request query object.

### Claim 10 (depends on 1)

The system of claim 1, wherein the cursor map identifies a relationship between the first cursor identifier for the client and the second cursor identifier of the server.

### Claim 11

A system comprising:
a device comprising one or more processors, coupled to memory, and intermediary to a plurality of clients and a plurality of servers, the plurality of servers providing access to a database, the device configured to:
receive a structured query language (SQL) query to access the database,
select, based on at least one of a policy or load balancing, a server from the plurality of servers over which to multiplex SQL queries;
store, in a cursor map, a first cursor identifier for the client identified from the SQL query;
identify via the cursor map a server cursor identifier for a selected server, the device maintaining in the cursor map one or more server cursor identifiers to reuse for the selected server;
modify the SQL query to use the second cursor identifier instead of the first cursor identifier; and
forward the SQL query to the selected server.

### Claim 12 (depends on 11)

The system of claim 11, wherein the device is further configured to receive the SQL query via a first connection established between the device and the client.

### Claim 13 (depends on 11)

The system of claim 11, wherein the device is further configured to forward the SQL query via a second connection established between the device and the server

### Claim 14 (depends on 11)

The system of claim 11, wherein the device is further configured to select the server based at least on a property of a connection between the device and one of the client or the server

### Claim 15 (depends on 11)

The system of claim 11, wherein policy comprises an expression to identify predetermined data from content of the SQL query.

### Claim 16 (depends on 15)

The system of claim 15, wherein the predetermined data comprises one or more of the following: client user name, client database and request query object.

### Claim 17 (depends on 15)

The system of claim 15, wherein the device is further configured to select the selected server from the plurality of servers based on applying the expression of the policy to content of the SQL query.

### Claim 18 (depends on 11)

The system of claim 11, wherein the server identifier corresponds to a context of the server.

### Claim 19 (depends on 11)

The system of claim 11, wherein the server identifier is configured to be generated by the server responsive to the SQL query corresponding to a new statement from the client.

### Claim 20 (depends on 11)

The system of claim 11, wherein the device is further configured to generate the server cursor identifier for the selected server.
