1

Thanks for taking the time to look into my issue.

I currently have a MongoDB Atlas global write cluster with three region-specific shards in UK, US, and HK. The unsharded collections are located exclusively on the UK shard, which is causing geographic latency issues for users in the US and HK regions.

I’m exploring ways to replicate the unsharded collections data to the US and HK shards to address this issue. Here’s one potential approach I’ve considered:

Proposed Solution:

Dedicated Shard with Geo-Distributed Replica Sets

Move all unsharded collections to a dedicated shard in the cluster. Add replica sets for this shard in the US and HK regions.

Use read preferences (e.g., nearest or secondary) in my Spring Boot application to direct reads to the appropriate replica set, reducing latency.

Questions: 1.) Is this a practical and standard approach for managing unsharded collections in a global cluster?

Given the relatively small size of the unsharded collections, would this approach be more cost-effective compared to creating a separate cluster for unsharded collections?

Pros of the Approach:

No need to manage multiple clusters or connection URLs, as replication happens within the existing cluster. Cost-efficient since we avoid creating and maintaining a separate cluster for unsharded data.

I would appreciate guidance from MongoDB Atlas experts on whether this approach is feasible and aligns with best practices.

3
  • You should ask this on Database Administrators Commented Jan 7 at 3:44
  • For me this approach makes sense. How big is this collection? Is it possible to load and keep the data in the memory of your application? Commented Jan 7 at 6:49
  • Unsharded collections should be stored in the primary shard for the database, which is reported in the sh.status() command. If only a subset of collections are needed in each region, they could be stored in a database with the appropriate primary shard. Commented Jan 7 at 19:10

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.