Use cases for read concern set as secondary

Hi folks, I just watched the read preferences section and I wonder why would I set secondary or secondaryPreferred as a read preference.

Could you provide some use cases?

Thanks!

Hi @Hiram_Guerrero

One we could imagine is the primary being overloaded, as it is the default node for read-write ops.

So to reduce the traffic, read queries are send to the secondary, and writes to the primary.

As you are aware, this could retrieve stale data. So it depends on the particular application. Probably not ideal for a chat app, for example.

read pref, MDB manual.

2 Likes

That’s right, it seems like a good way to balance the traffic. Thanks for the links and the explanation Santiago!

You’re very welcome, see you around. :slight_smile: