Feature Request: DNS record per zone for global cluster
Today Atlas creates a single DNS record for the global cluster which has SRV records pointing to all servers in the cluster across all zones.
This causes issues when a service hosted in US tries to use this DNS record as it now connects to every server in the SRV list of the DNS record. We ideally would want the US service to connect to its closest mongos router (US zone) and not all the mongos routers as it is unnecessary waste of resources. Our workaround today is to manually pick the servers and build the connection string in old format.
Would it be possible to create a DNS record per Zone for global clusters so we don't have to manage as and when new servers are added to the zones and use the new mongodb+srv connection string format?
-
Kushal commented
Hi Andrew,
We noticed that the java mongo sync driver was attempting to create connections to all servers present in the DNS -> SRV records. Is this expected?
Let me rephrase this: How does the mongo driver know the closest servers to connect to? Does it make a connection to every server and does it drop them once it has resolved the closest servers? How many servers does it typically keep the connection alive with?
-
Hi Kushal,
The MongoDB driver should automatically find the nearest (by latency) mongos and use that for its connections. Have you actually run into issues where this wasn't happening, or are you speculatively looking ahead to avoid issues?
Either way I'd like to get a product manager in touch with you
Cheers
-Andrew