Node Express APP 1 to N (with MongoDB)

Viewed 309

we are developing a big node app with express and MongoDB. We are trying to get the best performance, because we will have multiple clients (maybe 100+) running on the same server.

We were thinking in a one-to-n APP, one instance, one database and multiple clients accessing their domains.

I want to know what is the best settings for this scenario (one server, multiple clients) to performance and development

  1. One instance, one database (clients data would be identified by a company ObjectId on the entry and clients would access a domain or subroute)
  2. One instance, multiple tables (or databases, what is the best?)
  3. Multiple instances, multiple tables
  4. Any other ideas?

On the first setting, the developers will always worry about the current company and this can bring limitations to the app

On the second setting, the concern will continue but the company will not interfere on the database entries (more clean model)

On the third setting (maybe the best for development) only one company will be treated and brings a lot of possibilities, but may bring performance issues (all instances will run on a single server)

Other settings I have not thought of can be better.

Notes:

We are using the mongoose library

I have some experience with WordPress and i like the way themes and plugins are created for it. We are trying to achieve a level of performance similar to Wordpress with PHP (several Wordpress running on a server efficiently)

sorry about bad english

1 Answers
Related