AzureSDKForRust icon indicating copy to clipboard operation
AzureSDKForRust copied to clipboard

Cosmos add a GlobalEndpointManager

Open glademiller opened this issue 5 years ago • 1 comments

In the JS SDK and I presume and other official Cosmos SDK implementations a cache of available regions is used to pick a URL to write to based on a list of preferred regions provided to the client. Without this I can easily set a region URL manually but without something like the endpoint manager the region might not be available when I make my next request.

From what I can ascertain the JS SDK refreshes the endpoint list every 5 minutes by default.

The region URLs are stored in the Database Account resource which doesn't appear to be exposed at this moment in this SDK.

glademiller avatar Apr 04 '19 18:04 glademiller

After the aforementioned issue we will have the necessary info to implement a global endpoint manager. I do not like the "automagic" refresh behind the scenes, it might work for JS/C# but in Rust I prefer to have more control. I probably will only allow to move between endpoints at user request. This means that the endpoint refresh and selection will be up to the caller (the latter being the case in JS/C# anyway).

MindFlavor avatar May 25 '20 09:05 MindFlavor