snowflake-connector-nodejs icon indicating copy to clipboard operation
snowflake-connector-nodejs copied to clipboard

Connection Pool for snowflake connection

Open nirmalparekh1984 opened this issue 5 years ago • 9 comments

I tried to look up but I didn't find any good resource that with info on how to build a connection pool using snowflake nodejs driver. Any pointer are appreciated

Also is there a way to reduce the connection live time

nirmalparekh1984 avatar Nov 25 '19 16:11 nirmalparekh1984

+1 To this question. Nodejs driver connection latency is really abysmal. Seeing 5-8 seconds for a connection, and under 1 second for the query. A connection pool would help, and not terribly hard to build, but reducing the connection latency would go a long way to improving the usability.

bholbrook73 avatar Jan 20 '20 18:01 bholbrook73

Wondering if there are any updates on connection pools with the nodejs driver?

zeusstl avatar Sep 01 '20 03:09 zeusstl

Is there any update w.r.t to connection pools with the nodejs driver. Is this feature going to come in upcoming releases?

kunalkatkar1 avatar Dec 10 '20 15:12 kunalkatkar1

Agreed, this would be extremely useful for us.

fimbulvetr avatar Dec 10 '20 16:12 fimbulvetr

Though it would be nice to have built in support for connection pooling, you should be able to set up your own connection pool that works with the snowflake nodejs driver fairly easily using https://www.npmjs.com/package/generic-pool

jacobworrel avatar May 13 '21 22:05 jacobworrel

I've written a small article on this. Please clap if you find it helpful! Creating a connection pool for Snowflake

abhijeet-pandhe avatar Jun 15 '21 08:06 abhijeet-pandhe

For those looking for this feature, check out: snowflake-pool

It's a wrapper that creates a connection pool using generic-pool under the covers. I went ahead and published it as an NPM package for those who are interested. It also makes use of the snowflake-promise API which I find a bit more elegant than the promise-based SDK.

@Naruto248 Please have a look and see if it would be useful for you as well. Also, if you wanted to make any contributions, just let me know. Happy to include your experience here as well.

jorshali avatar Jun 15 '21 18:06 jorshali

I just found out that connection pooling has been natively supported by snowflake-sdk: https://github.com/snowflakedb/snowflake-connector-nodejs/pull/186. I haven't found any public documentation for this feature though.
Update: found this doc section https://docs.snowflake.com/en/user-guide/nodejs-driver-use.html#creating-a-connection-pool

datbth avatar Mar 03 '22 05:03 datbth

I just found out that connection pooling has been natively supported by snowflake-sdk: #186. I haven't found any public documentation for this feature though. Update: found this doc section https://docs.snowflake.com/en/user-guide/nodejs-driver-use.html#creating-a-connection-pool

Seems like it uses a callback interface!?! What year is this? Snowflake never ceases to amaze.

iwyrkore avatar May 25 '22 18:05 iwyrkore

connection pool support released with v1.6.3, thank you for your patience

sfc-gh-dszmolka avatar Jan 14 '23 07:01 sfc-gh-dszmolka