0
votes

In Performance tips of Cosmos DB suggested by Microsoft, it is recommended to use Direct Mode i.e. TCP and HTTPS protocol to query Cosmos DB, just wanted to know what is default connection policy of Cosmos DB document Client?

var client = new DocumentClient(new Uri(endpointUrl), _primaryKey)

If I use above code, what Connection Policy will be used? https://docs.microsoft.com/en-us/azure/cosmos-db/performance-tips

1

1 Answers

1
votes

If I use above code, what Connection Policy will be used?

I think the performance tips article already has made it clear. If you do not set the direct mode in sdk, it will be Gateway Mode (default).

You could see the statement:

Gateway Mode is supported on all SDK platforms and is the configured default. If your application runs within a corporate network with strict firewall restrictions, Gateway Mode is the best choice since it uses the standard HTTPS port and a single endpoint.