What's the difference between CosmosClient and DocumentClient, in Java. Should I prefer one over the other, and why?
Simply put, CosmosClient is part of new SDK for Azure Cosmos DB SQL API while DocumentClient is part of the old SDK (when Cosmos DB SQL API was called DocumentDB).
Old SDK Github Repo: https://github.com/Azure/azure-documentdb-java
New SDK Github Repo: https://github.com/Azure/azure-sdk-for-java/tree/master/sdk/cosmos/azure-cosmos
Other big difference is the the new SDK supports both async and sync whereas the older SDK only supports sync.
Considering the old SDK has not been updated in quite some time, the recommendation would be to use the newer one.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With