US 11,943,316 B1
Database connection multiplexing for prepared statements
Yoni Shalom, Vancouver (CA); Negar Koochakzadeh, North Vancouver (CA); and Prateek Sahu, Langley (CA)
Filed by Amazon Technologies, Inc., Seattle, WA (US)
Filed on Dec. 2, 2022, as Appl. No. 18/073,889.
Int. Cl. H04L 67/5682 (2022.01); G06F 16/25 (2019.01)
CPC H04L 67/5682 (2022.05) [G06F 16/252 (2019.01)] 20 Claims
OG exemplary drawing
 
1. A method comprising:
receiving, by a database proxy, and from a client via a client connection, a parse message defining a prepared statement (PS) in association with a first database transaction;
selecting, by the database proxy in association with the first database transaction, a first database connection from a pool of database connections between the database proxy and a database;
forwarding, by the database proxy in association with the first database transaction, the parse message to the database via the first database connection, wherein the parse message causes the database to set up the PS in association with the first database connection;
storing, by the database proxy, PS setup data in state data associated with the client connection, wherein the PS setup data is based on the parse message;
receiving, by the database proxy, and from the client via the client connection, a bind message that references the PS in association with a second database transaction;
selecting, by the database proxy in association with the second database transaction, a second database connection from the pool of database connections;
sending, by the database proxy in association with the second database transaction, an injected parse message to the database via the second database connection based on the PS setup data, wherein the injected parse message causes the database to set up the PS in association with the second database connection; and
forwarding, by the database proxy in association with the second database transaction, the bind message to the database via the second database connection.