How to squeeze the most out of a replica set's secondary members?

Hi,
In mongo atlas, I have a primary and two secendary instances. Secendary as read replicas, all they do is back up data from primary, for the rest of the time they stay idle. Unfortunately, database management is not my forte, I am a beginner in it. I would like to know how can I get more out of these secendary instances? How, for example, how to redirect some of the reading queries from primary to secendary so that this traffic is distributed fairly regularly. Where to find information on how to do it? Preferably with examples. How to solve such problems?

Hello @Jonathan_Snowing, you can specify the Read Preference for your replica set:

Read preference describes how MongoDB clients route read operations to the members of a replica set.

There are various Read Preference modes with different behavior and you can use the one which suits your requirement. By default, the mode is Primary - that is all read operations are directed to the replica set’s primary member.

[EDIT]
Removed the incorrect link to Read Preference.

2 Likes

Hello @Prasad_Saya, I think by mistake you have added the wrong link for Read Preference,

Hello @Jonathan_Snowing, You can follow the link:

1 Like