Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mongodb Range Based sharding

I would like to shard my collection on the basis of range on mongodb shards, my question is if shard key is string field then how will we divide string based shard key in different chunks for range based sharding ???

like image 774
Numan Hanif Avatar asked Nov 10 '22 09:11

Numan Hanif


1 Answers

You can divide a string across shards using tag aware sharding. You create the "tags" denoting the ranges of the key to assign to a specific shard. Mongo's balancer will handle the distribution of the data and when you write a query for the key in question Mongo will know to target only that shard.

For more information see the following URL from the vendor. sharding-introduction/

like image 109
SDillon Avatar answered Nov 15 '22 11:11

SDillon