[DRIVERS-2569] Hybrid SRV connection string format for faster initial discovery Created: 03/Mar/23  Updated: 28/Nov/23

Status: Backlog
Project: Drivers
Component/s: Connection String, FaaS, Performance
Fix Version/s: None

Type: New Feature Priority: Unknown
Reporter: Shane Harvey Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DRIVERS-2757 Retry on DNS failure for up to connec... Backlog
Driver Changes: Needed

 Description   

Summary

When comparing mongodb+srv:// and mongodb:// URIs, srv is great because it allows Atlas to change/add/remove the underlying hosts without code or configuration changes. SRV has some downsides though, 1) it adds latency overhead for the initial connection and the time to first command (TTFC) and 2) it SRV+TXT lookup is not as stable in some environments leading to lookup errors.

We should consider adding a hybrid format with the benefits of both, for example:

"mongodb://cluster1.mongodb.net:27017,[more hosts...]/?srvHost=cluster1-srv.mongodb.net"

The driver would optimistically connect to the hosts in the URI and perform the SRV+TXT lookup in parallel to discover if the hosts have changed. Applications could use this format to reduce the TTFC. It would also allow the driver to connect even if SRV/TXT lookup fails assuming the hosts in the URI have not changed.

Motivation

Who is the affected end user?

Who are the stakeholders?

How does this affect the end user?

Are they blocked? Are they annoyed? Are they confused?

How likely is it that this problem or use case will occur?

Main path? Edge case?

If the problem does occur, what are the consequences and how severe are they?

Minor annoyance at a log message? Performance concern? Outage/unavailability? Failover can't complete?

Is this issue urgent?

Does this ticket have a required timeline? What is it?

Is this ticket required by a downstream team?

Needed by e.g. Atlas, Shell, Compass?

Is this ticket only for tests?

Does this ticket have any functional impact, or is it just test improvements?


Generated at Thu Feb 08 08:25:54 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.