Skip to main content

What are the internals of the balancer decision algorithm in sharded clusters?

Expert MongoDB
Quick Answer The balancer checks chunk counts across shards every 10 seconds. It triggers migration when the imbalance (most chunks - fewest chunks) exceeds a threshold based on total chunk count. It picks the chunk to move based on size and migration history. You can configure balancerCollectionStatus to check, and set chunksize to control when splits occur. The config server coordinates all migration metadata.

Answer

The balancer evaluates chunk counts, data size, and cluster history. It throttles migrations and uses metadata from config servers for safe relocation.
S
SugharaIQ Editorial Team Verified Answer

This answer has been peer-reviewed by industry experts holding senior engineering roles to ensure technical accuracy and relevance for modern interview standards.

Want to bookmark, take notes, or join discussions?

Sign in to access all features and personalize your learning experience.

Sign In Create Account

Source: SugharaIQ

Ready to level up? Start Practice