Is there any way to shard the gridFS files and chunks based on a location information ?
I want to setup a mongo configuration with sharding and replication for handling multi-sites and guaranteeing that the data produced on one site remains accessible even if the sites are isolated.
I followed the following documentation from mongo and it works just perfectly for the standard collections but not for GridFS.
https://docs.mongodb.com/v3.2/tutorial/sharding-segmenting-data-by-location/
All I found for GridFS was _id based or file_id based sharding. By now the only solution I have would be to use different GridFS prefixes which means different collections and to shard them each on a given site.
I'm using :
Thanks for any advice.
I found an answer on StackExchange : How to define shardKey on GridFS collections to achieve Location/Data Centre affinity (MongoDB)
Given that the only possibility is to shard the chunks on the ID, the idea is to use MongoGridFSCreateOptions to force a location-based ID to the chunks.