I am building an app that stores sensitive data for severals different customers in Mongo DB. The data model is the same for each client (emails, contacts, meetings). All clients access the data using the same API with the same Express server. I have read a lot about using one large collection vs several collections vs several databases:
Mongoose and multiple database in single node.js project
MongoDB performance - having multiple databases
I like the idea of using one database per client because of security and simple seggregation of the data. Am I right to think like that?
Also in this scenario I am a bit concerned about managing databases connections in Express.
I understand that the connection should only be made once (e.g. when starting the server) and then kept alive. So using several databases would mean that Express opens several connections and keeps them alive, maybe dozens or hundreds in the future. Also, with every api call the controller should be able to chose which database connection to query from.
Is it worth the trouble?