You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently Azure Cosmos DB .NET SDK v3 for SQL API Microsoft.Azure.Cosmos is the recommended and preferred SDK to interact with Cosmos DB.
In some scenarios depending on the use case and to leverage benefits of EF Core (like odata support in our case), one also uses EF Core Azure Cosmos DB Provider (Microsoft.EntityFrameworkCore.Cosmos).
In such scenarios when a consumer is using both the SDKs to interact with cosmos DB, one ends up having two CosmosClient instances per AppDomain. This seems like an overhead and not optimal usage of resources ( Connection management/Serializers) leading to double footprint of memory and network.
How about we provide an option to reuse/inject CosmosClient during the initialization of the EF Core assets or leverage DI in appropriate layer to get any already registered instance of CosmosClient.
The text was updated successfully, but these errors were encountered:
Currently Azure Cosmos DB .NET SDK v3 for SQL API
Microsoft.Azure.Cosmos
is the recommended and preferred SDK to interact with Cosmos DB.In some scenarios depending on the use case and to leverage benefits of EF Core (like odata support in our case), one also uses EF Core Azure Cosmos DB Provider (
Microsoft.EntityFrameworkCore.Cosmos
).In such scenarios when a consumer is using both the SDKs to interact with cosmos DB, one ends up having two
CosmosClient
instances perAppDomain
. This seems like an overhead and not optimal usage of resources ( Connection management/Serializers) leading to double footprint of memory and network.As per the recommendation for better performance, we should strive for single instance of
CosmosClient
per AppDomain.https://docs.microsoft.com/en-us/azure/cosmos-db/sql/performance-tips-dotnet-sdk-v3-sql
How about we provide an option to reuse/inject CosmosClient during the initialization of the EF Core assets or leverage DI in appropriate layer to get any already registered instance of CosmosClient.
The text was updated successfully, but these errors were encountered: