MongoDBProblem & solution
How Observe.AI Used MongoDB Resharding to Scale Its AI Platform
Summary
Observe.AI partnered with MongoDB Consulting to scale a production MongoDB Atlas cluster from two data shards holding roughly 50 TB of uncompressed data to a healthier multi-shard layout. The team used MongoDB 8.0 resharding instead of relying solely on the balancer for the initial large-scale data movement, because balancer-driven chunk migrations would have extended the migration window and kept original shards under pressure. Resharding was run sequentially on the largest collections, with the largest collection (collection7) taking 38.8 hours to redistribute 19.67 TB. Production reads and writes continued during the clone and catch-up phases, with only a brief write-blocking critical section during the final commit. After migration, the balancer returned to incremental rebalancing while the heavy data movement was handled through the resharding workflow.
Context
Observe.AI’s MongoDB Atlas cluster had two data shards each holding roughly 13 TB of compressed data (50 TB uncompressed) on M140 tier with ~14 TB disk limit, leaving limited headroom. The sustained ingest rate of ~50 GB per day made proactive capacity expansion important to avoid performance issues or service degradation.
Approach / What changed
The team added new shards, disabled balancing and range deletions, then ran reshardCollection sequentially on each large collection to redistribute data across the expanded shard footprint while keeping the same shard key. After redistribution, they removed old empty shards, removed temporary zone configurations, and re-enabled balancing and range deletions.
Takeaways
MongoDB 8.0 resharding allows redistributing data across shards online with minimal write disruption, making it suitable for large-scale production data movements.
Relying solely on the balancer for initial large-scale redistribution can extend the migration window and keep original shards under prolonged pressure; resharding provides a faster, more controlled alternative.
Disabling range deletions and chunk migrations for critical collections before resharding prevents IOPS competition between resharding traffic, the balancer, and the range deleter.
FAQ
How does resharding differ from balancer-driven chunk migration?
Resharding redistributes data across shards by changing ownership distribution while keeping the same shard key. The balancer handles ongoing incremental balancing, but for large-scale initial data movement, resharding is faster and more predictable than relying solely on chunk migrations.
Does resharding require application downtime?
Production reads and writes continued during the clone and catch-up phases. Only the final commit phase required a brief write-blocking critical section, minimizing disruption to production workloads.
What steps were taken to avoid performance contention during resharding?
The team disabled range deletions and disallowed chunk migrations for critical collections before resharding so that resharding traffic did not compete with the balancer and range deleter for IOPS. They also ran resharding sequentially per collection to avoid overloading donors, recipients, or the config server.
Source and freshness
- Source
- mongodb.com
- Published
- Added to Yomu
Summaries are generated from the original by a language model. Check the original before relying on it.
Keep reading
Related reading
The Good Stuff
Paid picks we use ourselves. Links carry a referral code — a subscription through one earns us a commission at no extra cost to you.
The best engineering reads, once a week
One useful email. Unsubscribe anytime.