MongoDB Balancer:move data inside replication set or across replication set

load balancingmongodb

After reading the document of mongodb on the balancer topic , I have two questions:

1.If I set Balancer on , will the db operation efficiency will be
influenced ?

2.Still ,I cannot understand what data is moved from where to where by balancer.I know that for each shard ,mongodb has a replication set to back up data.Then ,what does balancer do?It move data inside a replication set(from one replication set member to another ,but both belongs to the same replication set) or it move data from one shard to another
shard(from one replication set to another)?

Best Answer

1 - Yes, the balancing operation can affect the performance, that's why you can schedule the balancing window. By default, the balancer is enabled and may run at any time.

2 - The balancer moves data chunks between shards.

Just to clarify, each shard is a replica set. All members of the replica set (the primary and N secondaries) have the same data (replicated). Therefore, each shard has a different subset of the total data.