I'm implementing a nodejs server which is using mongodb as database and mongodb-native library to connect it.
Further, I'm using clustering to enhance the server performances. So there are two possible ways to use mongodb-native driver's connection pooling;
- Create a single connection pool and pass it to each child process when creating them (singleton pattern)
- After a child process created, creates a connection pool internally
So, my question is, what's the best methods among two of them? Or is there any other good method to do so?