Multiple Databases in MongoDB for SaaS

I am creating a SaaS application in node.js and want to use MongoDB for a database with Mongoose ODM. I will need to support several clients, between hundreds and thousands (I hope), and there is no interaction between each client's data.

My idea was to create a new database for each client and a single "main" database that contained global information. For example, the application will have one login page, so I want to save all the user / password information in the "main" database, but all user profile data in the client database to which they belong. I felt that this would be a good design, since it completely isolates the data of each client and will simplify backing up / restoring the client individually.

I am worried about the performance impact on connecting to multiple databases from node.js. Does anyone know how this will affect this application or any opinions on the architecture as a whole?

Bonus question: do you know any audit results regarding the return and storage of all client data in one database, separated by the client, in the SaaS solution?

+5
source share
1 answer

This is not an easy answer, because a lot depends on the architecture of your application, patterns of use and requests, distribution between clients (i.e. whether the levels of use will be approximately the same for clients or you can have 10% of clients using 90% of resources), how much you can spend on code and operations management and a number of other problems. Here are a few things to consider:

1) , , , . /-, .

:

  • ( : ) clientid , . ( ) .
  • - , clientid ( : clientid_userprofiles).

2) , . , , . . , .

3) - ( , ), , test/freemium.

, , -smallfiles startup. , , " ", .

, , . https://groups.google.com/forum/?fromgroups#!searchin/mongodb-user/multitenant, Mongo .

, , . , 1000 , ( - 10 100 ), , , , SAS70 .. , - , ? , , .

+5

All Articles