Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure DocumentClient thread safety

Is DocumentClient thread safe?

I get mixed messages:

From MSDN https://msdn.microsoft.com/library/azure/microsoft.azure.documents.client.documentclient.aspx :

Any public static ( Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

From MS blog https://azure.microsoft.com/en-us/blog/performance-tips-for-azure-documentdb-part-1-2/ :

SDK Usage Tip #1: Use a singleton DocumentDB client for the lifetime of your application Note that each DocumentClient instance is thread-safe and performs efficient connection management and address caching when operating in Direct Mode. To allow efficient connection management and better performance by DocumentClient, it is recommended to use a single instance of DocumentClient per AppDomain for the lifetime of the application.

like image 459
Mixer Avatar asked Sep 15 '16 14:09

Mixer


People also ask

Is cosmos Container thread-safe?

CosmosClient is thread-safe. Its recommended to maintain a single instance of CosmosClient per lifetime of the application which enables efficient connection management and performance.

Is TableClient thread-safe?

Yes, TableClient is thread safe.


1 Answers

Sorry for the confusion. We are aware of this issue and I have reported this to our documentation team. This a bug in the documentation tool that we use to generate the docs. I'll follow up with them on the status.

Yes, DocumentClient is thread-safe.

Regards, Rajesh

like image 126
Rajesh Nagpal Avatar answered Oct 05 '22 21:10

Rajesh Nagpal