Artem Vertiy
Artem Vertiy

Reputation: 1118

Azure Cosmos api client which one to select Azure.Cosmos or Azure.DocumentDB.Core?

I have found 2 official packages

  1. Microsoft.Azure.DocumentDB.Core

This client library enables client applications targeting .NET Core to connect to Azure Cosmos DB via the DocumentDB (SQL) API.

For this package also found great SDK with ORM support Cosmonaut

  1. Microsoft.Azure.Cosmos

This client library enables client applications to connect to Azure Cosmos via the SQL API.

As I understand the 1st one is for people who used Azure Document DB before, so kind of migration package and the 2nd one would be better for new projects.

The thing is that we had started 2 weeks ago development using the 1st one but it looks Microsoft.Azure.Cosmos client api is designed a bit better and it's more convenient to use it than DocumentDB client.

Am I correct, that for new projects it would be more convenient to go with Microsoft.Azure.Cosmos client rather than Microsoft.Azure.DocumentDB client?

Upvotes: 2

Views: 1492

Answers (2)

Pablo V
Pablo V

Reputation: 71

Just to add some more info about why to use Azure Cosmos DB .NET SDK v3 instead of Azure Cosmos DB .NET SDK v2

From Microsoft:

On August 31, 2024 the Azure Cosmos DB .NET SDK v2.x will be retired; the SDK and all applications using the SDK will continue to function; Azure Cosmos DB will simply cease to provide further maintenance and support for this SDK. We recommend migrating to the latest version of the .NET SDK v3 SDK.

Interesting links about how to migrate from Azure Cosmos DB .NET SDK v2.x to Azure Cosmos DB .NET SDK v3 if you are using it already

Migrate your application to use the Azure Cosmos DB .NET SDK v3 https://learn.microsoft.com/en-us/azure/cosmos-db/sql/migrate-dotnet-v3?tabs=dotnet-v3

Cosmos .NET SDK v3 upgrade guide and tips https://elcamino.cloud/articles/2019-11-05-cosmos-net-sdk-v3-upgrade-guide-and-tips.html

Upvotes: 0

Artem Vertiy
Artem Vertiy

Reputation: 1118

Found an answer

Microsoft.Azure.Cosmos is a version 3 of SDK and it replaces the older one DocumentClient

Version 3 of the SDK contains numerous usability and performance improvements, including a new intuitive programming model, support for stream APIs, built-in support for change feed processor APIs, the ability to scale non-partitioned containers, and more.

For new workloads, we recommend starting with the latest version 3.x

Upvotes: 6

Related Questions