If I now start a Scala app using the official driver and specify i.e. three nodes in my MongoDB connection string, what will happen?
Hi Markus,
The MongoDB Scala Driver implementation is built upon the MongoDB Async Java Driver.
Based on the Driver: Server Selection Specification the Java driver implemented LatencyMinimizingServerSelector, which will load balance all operations across the available mongos
servers using the following consideration:
mongos
plus all mongos
within specified latency windowFor example, if there are three mongos
: ms1
, ms2
, and ms3
, whose ping times are 10, 15, and 16 milliseconds, respectively. If local latency window specified is 5 milliseconds, the selection would be either ms1
or ms2
(randomly selecting between the two).
The default local latency window value is 15 milliseconds.
See also :
Regards,
Wan.