How do implement Multi tenant architecture and data model in MongoDB 3.3?

2,009 views
Skip to first unread message

ja...@northdomesolutions.com

unread,
Nov 2, 2016, 1:43:44 PM11/2/16
to mongodb-user
Hello,
I would like to design a spark/MongoDB architecture which will hold 10000+ customer data.

The most important goal is to provide data isolation so each customer data at rest and in motion is completely isolated from other customer.

Creating one database per tenant and having a replica set of 3 per tenant will result in 30000 databases, which will escalate TCO (total cost of operation).

Implementing one collection (super table )  per customer and making all child tables as child collections -  aka collection of collections will lead to a messy design.

Any alternative solutions please?
The whole problem is because MongoDB does not have a design structure equivalent to a SCHEMA where a database can have multiple SCHEMAS and each schema can have multiple collections.  Then each schema data (at rest ) will can be isolated with one file per customer and encrypted.

Thanks
Jagan

Wan Bachtiar

unread,
Nov 10, 2016, 2:04:11 AM11/10/16
to mongodb-user

The whole problem is because MongoDB does not have a design structure equivalent to a SCHEMA where a database can have multiple SCHEMAS and each schema can have multiple collections.  Then each schema data (at rest ) will can be isolated with one file per customer and encrypted.

Hi Jagan,

I'm not sure what 'schema' you are referring to here.

In MongoDB, a database can contain one or many collections, a collection can contain one or many documents. Generally documents in MongoDB collection share a similar data model structure or schema. Normally enforced on application side, although in some cases through document validation.

You may find a video from previous MongoDB World useful : Securing MongoDB to Serve an AWS-Based, Multi-Tenant, Security-Fanatic SaaS application. Which talks about architecture considerations ranging from isolated to shared.

See also the following resources for extra information:

Regards,

Wan.

Reply all
Reply to author
Forward
0 new messages