You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
sharedb-mongo provides two ways of accessing a mongodb database:
a) takes a url, creates a client, connects to the server, accesses the database
b) takes a client, connects to the server, accesses the database
The second approach provides better flexibility and saves resource.
In fact, there is a better way:
c) takes a database
The third approach enables creating thousands of sharedb instances without hitting connection limitations since each connect() call creates another connection pool.
I'm not good at NodeJS but I changed the source code and it enabled running 4000 sharedb instances with 150 mongodb connections. I think this is a good result.
"To reduce the number of connection pools created by your application, we recommend calling MongoClient.connect once and reusing the database variable returned by the callback:"
See #56 (comment) for another discussion about this feature request.
The text was updated successfully, but these errors were encountered:
sharedb-mongo provides two ways of accessing a mongodb database:
a) takes a url, creates a client, connects to the server, accesses the database
b) takes a client, connects to the server, accesses the database
The second approach provides better flexibility and saves resource.
In fact, there is a better way:
c) takes a database
The third approach enables creating thousands of sharedb instances without hitting connection limitations since each connect() call creates another connection pool.
I'm not good at NodeJS but I changed the source code and it enabled running 4000 sharedb instances with 150 mongodb connections. I think this is a good result.
Notes:
Mongodb documents about connection pooling:
https://mongodb.github.io/node-mongodb-native/driver-articles/mongoclient.html#mongoclient-connection-pooling
"To reduce the number of connection pools created by your application, we recommend calling MongoClient.connect once and reusing the database variable returned by the callback:"
See #56 (comment) for another discussion about this feature request.
The text was updated successfully, but these errors were encountered: