Can we do incremental sync based on a schedule?

Can we sync a mongodb database to another incrementally based on a schedule? Say, once every night at 12 am?

Background:
We have a MongoDB replica cluster consisting of 3 instances, all located within one data center. For backup, the company is acquiring another server in a different country. This rises two questions for us.

  1. Does MongoDb allow us to do schedule syncing.
  2. Can the syncing be incremental by not replacing data that is already synced.

We initially thought of adding the new server to the replica set as a passive replica. However, we got input that it will slow down the cluster as the new server will have high latency.

Hello,

Synchronisation in MongoDB is an ongoing process, once a new instance is added and an initial sync is done, no need to replace or resync an instance in order to keep it up to date, so you don’t have to schedule sync on specific timestamps.

While it’s true that for the newly added remote instance in a different country will take longer to acknowledge write which will increase the overall write latency for your workload, but that’s only if that instance is an active participant in write acknowledgment.

You could consider setting the priority of the new instance to 0, this will prevent the instance from becoming primary and it cannot trigger elections, for write concern of “majority” if the instance is a non-voting member it will not contribute in write acknowledgment. and so, application workload will not wait for this instance’s write acknowledgment.

This situation is explained in more details actually in this documentation link about priority 0 replica set members, they mention exactly the situation of a replica set member in a different “remote” data center as in your case.

You can also check below documentation link about initial sync in MongoDB:

And this link about replica set deployment architectures:

This one about replica set distributed across two or more data centers:

I hope you find this helpful.

2 Likes

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.