Enabling sharding on a database

26 views
Skip to first unread message

qplc

unread,
May 31, 2019, 9:02:37 AM5/31/19
to mongodb-user
Hi,

I want to enable sharding on database only restricting the same on collections.
Can I explicitly mention shard server while enabling sharding on a database?
Suppose, I've 2 databases for 2 different tenants.
Can I specify the shard server A for Tenant 1 and shard server B for Tenant 2 explicitly or through configuration?


Thanks,
plc

Kevin Adistambha

unread,
Jun 3, 2019, 1:04:02 AM6/3/19
to mongodb-user

Hi,

Can I specify the shard server A for Tenant 1 and shard server B for Tenant 2 explicitly or through configuration?

I think you’re referring to zone sharding.

The page Segmenting Data by Application or Customer possibly contains the use case example you have in mind.

Additionally, the page Deploy a Sharded Cluster should be a good starting point.

Best regards,
Kevin

qplc

unread,
Jun 3, 2019, 10:05:28 AM6/3/19
to mongodb-user
Thanks so much Kevin! Links provided by you are indeed helpful.

May I request you to clear some doubts in deciding MinKey and MaxKey for the zones in zoned sharding.

All examples given in the documents are based on numeric values ranges. e.g. zip.

Here, in the doc, specified MinKey and MaxKey are the possible values in the zip field?

In my example, if I choose a compound shard key (Tenant, EmailId) for zoned sharding assuming both fields are of text type.
How do I select MinKey and MaxKey?
Reply all
Reply to author
Forward
0 new messages