1

We created 10 nodes with Parse Server and they killed our Mongo database's Primary.

Is there a way we can set up Secondary Preferred for the reads on Parse servers otherwise the load will be put in the primary node?

rici
  • 234,347
  • 28
  • 237
  • 341
Nick Halavins
  • 31
  • 1
  • 2

3 Answers3

1

You should read this article about read preferences in MongoDB

If you use MongoDB Native driver or Mongoose you can achieve a read preference read this

Community
  • 1
  • 1
manuerumx
  • 1,230
  • 14
  • 28
0

By setting secondaryPreferred as the read preference.

The documentation statues for secondaryPreferred in most situations, operations read from secondary members but if no secondary members are available, operations read from the primary

Also you can tweak your secondary read preference by configuring maxStaleTimeout

Please go through the documentation for understanding more about read preference https://docs.mongodb.com/manual/core/read-preference/

Aarish Ramesh
  • 6,745
  • 15
  • 60
  • 105
0

The Parse Server docs you are looking for are here.

Example:

const query = new Parse.Query("MyClass");
query.readPreference("SECONDARY");
Manuel
  • 14,274
  • 6
  • 57
  • 130