What is the recommended approach towards multi-tenant databases in MongoDB?

Posted by Braintapper on Stack Overflow See other posts from Stack Overflow or by Braintapper
Published on 2010-05-01T03:55:23Z Indexed on 2010/05/01 3:57 UTC
Read the original article Hit count: 321

Filed under:
|

I'm thinking of creating a multi-tenant app using MongoDB. I don't have any guesses in terms of how many tenants I'd have yet, but I would like to be able to scale into the thousands.

I can think of three strategies:

  1. All tenants in the same collection, using tenant-specific fields for security
  2. 1 Collection per tenant in a single shared DB
  3. 1 Database per tenant

The voice in my head is suggesting that I go with option 2.

Thoughts and implications, anyone?

© Stack Overflow or respective owner

Related posts about multi-tenant

Related posts about mongodb