We recently starting using MongoDB and the new Scala driver library (v 1.1.1). We have not made any custom configurations but we are consistently running out of connections and getting connection timeouts. I worry that we are using the driver incorrectly.
Please see my questions below -
- We are using dependency injection to manage the MongoClient. Should be injecting MongoClient or MongoDatabase into all of our CRUD classes?
- Should we treat the MongoClient and/or the MongoDatabase as a singleton?
- Are there any other common mistakes people have seen with the Scala driver?
Thanks in advance...