0
votes

My company plans to migrate from a single node MongoDB to a MongoDB sharded cluster to enable horizontal scaling. We want to place one Mongos inside each backend worker container. Our backend worker container has quite a few mongo aggregation running, we afraid the aggregation could running inside the mongos if the aggregation requires cross shard operation like merging the result from multiple shards. Could somebody tell me do running Mongos inside a low memory container with cross shard aggregation is a good idea?

1

1 Answers

0
votes

Data merging will happen at one of the shard. So you can go with low memory container for mongos.

For more details refer https://docs.mongodb.com/manual/core/aggregation-pipeline-sharded-collections/