Multi-tenancy in mongodb

669 views
Skip to first unread message

Noor Ul Haque

unread,
Jan 13, 2018, 7:36:18 PM1/13/18
to mongodb-user
Hi,

There are multiple approaches for multi-tenancy in Mongo DB

1) Shared collection with tenantId as discriminator. 
2) Collection per tenant. 
3) Database per tenant. 
4) Database instance per tenant.

Which among the above options is best suitable from performance and database management point of view regardless of security?

Wan Bachtiar

unread,
Jan 17, 2018, 12:38:31 AM1/17/18
to mongodb-user

Which among the above options is best suitable from performance and database management point of view regardless of security?

Hi Noor,

I’m not sure with ‘best’ suitability, as this depends a lot on your requirements.

In regards to performance and database management, having a separate instance/deployment would likely be preferable. As you would be able to handle a tenant with massive data volume and/or process-intensive separately (scale up/down clusters).

Depending on your requirements, have you considered using MongoDB Atlas ?
In MongoDB Atlas, you can create an organisation which may contain many projects. Within a project you can associate clusters/deployments. See also MongoDB Atlas: users and teams

Regards,
Wan.

Reply all
Reply to author
Forward
0 new messages