Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Best practices for connection lifetime #656

Open
GuyHarwood opened this issue Nov 30, 2017 · 7 comments
Open

Best practices for connection lifetime #656

GuyHarwood opened this issue Nov 30, 2017 · 7 comments
Labels
Follow up Recent question asked by tedious members for old issues or discussion that requires member input

Comments

@GuyHarwood
Copy link

We have a fairly large node project, and are migrating from MongoDB/Cosmos to SQL Azure.

Most of the tedious examples open a single connection, run all of the example SQL commands and the connection is closed before the app exits. Nice and simple.

I am interested in understanding the best strategy for the connection Object lifetime in an express web application serving 10K+ users.

For example - should we open and close a connection after each sql call is executed? This is usually the norm in .NET/C#. ADO would handle the pooling, which you could configure in the connection string.

Interested in hearing advice and ideas/war stories from users of this library.

@tvrprasad
Copy link
Contributor

Check out https://github.com/tediousjs/tedious-connection-pool

@GuyHarwood
Copy link
Author

@tvrprasad thanks.

So, typically within a data access component / service you would reference the pool file (which would look like the example in the link above, without the actual query) and then acquire a connection, perform data operations and release it back to the pool?

@Suraiya-Hameed
Copy link
Member

Yes, that would be the right way to do it.

@dcherman
Copy link

@tvrprasad Are there any plans to upgrade the version of Tedious in use in that library? I'm asking here because it looks like several people have filed issues and merge requests attempting to do so, but no one has responded.

@tvrprasad
Copy link
Contributor

@dcherman I'm not currently active on the project. See #690 where @v-suhame recommended https://www.npmjs.com/package/mssql and https://www.npmjs.com/package/sequelize.

@arthurschreiber
Copy link
Collaborator

@dcherman I'll try and take a look. I've not contributed to tedious-connection-pool before - and I'm not sure if I can actually release a new version.

@IanChokS IanChokS added the Follow up Recent question asked by tedious members for old issues or discussion that requires member input label Dec 16, 2019
@Vizard21
Copy link

Vizard21 commented Oct 7, 2020

Check out https://github.com/tediousjs/tedious-connection-pool

I believe this library is out of date

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Follow up Recent question asked by tedious members for old issues or discussion that requires member input
Projects
None yet
Development

No branches or pull requests

7 participants