Is it better to use the mongodb driver pool instead of generic-pool for nodejs

Hello,

I would like to ask if it is better to use directly the mongo native pool instead of using some external package like generic-pool. Is there any drawbacks or benefits?

Thanks

Hi @Anton_Tonchev

Most official drivers implement a connection pool that is codified in this document: specifications/connection-monitoring-and-pooling.rst at master · mongodb/specifications · GitHub and explain here: Connection Pool Overview

Since this feature is already built-in, I don’t think you’ll have more value by connecting an external pooling library (I’m guessing you’ll end up with a pool within a pool). Especially when the official driver’s pooling behaviour was designed specifically with MongoDB in mind.

Best regards
Kevin

2 Likes

Thank you for the fast reply!