How do I manage MongoDB connections in a Node.js web application?

The primary committer to node-mongodb-native says: You open do MongoClient.connect once when your app boots up and reuse the db object. It’s not a singleton connection pool each .connect creates a new connection pool. So, to answer your question directly, reuse the db object that results from MongoClient.connect(). This gives you pooling, and will provide … Read more

Entity Framework and Connection Pooling

Connection pooling is handled as in any other ADO.NET application. Entity connection still uses traditional database connection with traditional connection string. I believe you can turn off connnection pooling in connection string if you don’t want to use it. (read more about SQL Server Connection Pooling (ADO.NET)) Never ever use global context. ObjectContext internally implements … Read more