3 ms·
I can only speak for MongoDB (and I use Atlas extensively), but in your example I would have two connections open to the MongoDB cluster on each web node (no ma
by andrewbarba 9y ago
I can only speak for MongoDB (and I use Atlas extensively), but in your example I would have two connections open to the MongoDB cluster on each web node (no matter where it's deployed). One connection would connect to the primary and handle all writes. The other connection would use the option "readPreference=nearest" which will connect to the geographically closest replica node.
https://docs.mongodb.com/manual/reference/read-preference/#nearest https://docs.mongodb.com/manual/reference/read-preference/#n...
Edit:
Looks like you can also tag the region your nodes are in and specify those tags directly, pretty neat.
https://docs.mongodb.com/manual/reference/read-preference/#query-from-geographically-distributed-members https://docs.mongodb.com/manual/reference/read-preference/#q...