Designing Mongo DB for Multi tenanted database

@Thirumalai_M - my two cents - since it’s going to be a Healthcare/HIPPA compliant - better to go with separate database per client, that gives the highest level of isolation and security and due to security & compliance: most clients usually may want to have the database deployed on their owned secured network (cloud or on-premise) only. At the same time - it also allows doing client specific customization’s later, if required. Now, the major drawbacks of this approach is the cost and maintenance overhead etc.

Had this been a non-healthcare system - you could have even thought of having single collection for all clients but segregating their rows/documents based on additional “tenant_id” column. Although, it only provides only logical level of isolation but it’s very easier to maintain and very cost effective. Depending on the number of clients/customers - you can easily scale it by having multiple shard clusters across - may be 1 for each and/or group of customers combined into one cluster i.e. tenant_id = 1 to 10 or tenant_name = A to M and tenant_id = 11 to 20 or tenant_name = M to Z into another cluster.

1 Like