Mongos dedicated to route only on secondary nodes of cluster

Hello MongoDB Folk,

I am looking for some inputs and thoughts on reading only from Secondary through dedicated mongos.

Is there any way to route all queries particularly from mongos that will read data only from secondary nodes of sharded cluster and no write will be entertained.

To achieve this below are the tools I am aware of and that too comes with a lot of constraints like no support on index sync and requires a lot of manual interventions in order to manage and replicate a whole new cluster.

mongo-connector and seems no more active: GitHub - yougov/mongo-connector: MongoDB data stream pipeline tools by YouGov (adopted from MongoDB)
mongo-shake - Documentation is not much clear: GitHub - alibaba/MongoShake: MongoShake is a universal data replication platform based on MongoDB's oplog. Redundant replication and active-active replication are two most important functions. 基于mongodb oplog的集群复制工具,可以满足迁移和同步的需求,进一步实现灾备和多活功能。

This is the improvement request I have submitted in MongoDB
https://jira.mongodb.org/browse/SERVER-52536
If the above improvement seems useful then please up-vote and any other tools or utility recommendations are most welcome.

I am not sure what your use-case for this. If to improve performances of the whole system you may want to consider that secondaries have the same workload as the primary. They performed the same amount of writes. So you might not see a lot of differences.

Before going to the complex route of having dedicated mongos, I would look at

and

for normal read workload as they may satisfy your use-case.

If you want mongos for reporting or analytic workload, you may consider https://www.developer.com/db/make-mongodb-replica-sets-work-for-analytics-without-compromising-availability.html

1 Like