c# - How to update multiple MongoDB servers simultaneously - direct mode or replica set? -
interested in using mongodb cache servers. relatively new mongo bear me ...
1 of tasks should perform following:
retrieve records database , update 2 mongodb servers. task writes mongo servers , doesn't perform "read" actions. task should run every 250 ms , amount of documents updated between 0 - 180 records (relatively small records - each record document).
know how can perform task using one update in code? (i not want loop on servers , perform update each of them)
one point mention: data in mongo servers should read locally @ each machine in order gain small latency possible.
should create replica set? if so, replica set reflect up-to-date data in each server given frequency of 250 ms?
or should connect them directly mongodb://server1,server2/?connect=direct
, perform 1 update in code translated 2 updates - 1 each server?
replies inline..
i know how can perform task using 1 update in code? (i not want want loop on servers , perform update each of them)
you can bulk insert or multi update. @ mongod server side, applied in sequence.
should create replica set? if so, replica set reflect up-to-date data in each server given frequency of 250 ms?
you can't sure replicated secondaries in 250 ms. but, default read goes primary ( replica-set ) up-to-date data.
or should connect them directly mongodb://server1,server2/?connect=direct , perform 1 update in code translated 2 updates - 1 each server?
you have connect 'mongodb://server1,server2?..options'. update goes primary, , update pulled secondary primary.
Comments
Post a Comment