What's New for Azure Cosmos DB SDKs for .NET and Java

Azure Cosmos DB is a globally distributed, multi-model database service, helping users and developers elastically and independently scale throughput and storage across Azure regions with a click of a button. These resources can be elastically scaled to leverage fast, single-digit-millisecond data access via popular APIs including SQL, MongoDB, Cassandra, Tables, or Gremlin.

Microsoft has recently beefed up associated SDKs for Azure Cosmos DB. Here's a look at a couple such enhancements enacted within the last month.

Azure Cosmos DB
[Click on image for larger view.] Azure Cosmos DB (source: Microsoft).

Azure Cosmos DB .NET Standard SDK for SQL API (.NET SDK)
This was updated just last week, to version 3.8.0 (preview). That update entailed improving the bulk support introduced last November. At the time, an associated blog post explained that "bulk" had to do strictly with throughput, not latency. Examples of bulky scenarios include:

  • A nightly dump of 2 million records into a Cosmos DB container
  • Processing a stream of data that batched into 100,000 items that need updating
  • Dynamically generating groups of operations that execute concurrently

Last week's update to v3.8 added a congestion control component, helping out with the tool's functionality dealing with concurrent operations, partition affinity, multiple parallel requests and other technical details.

Just one upshot of this improvement is:

This change means that we are increasing the data flow from the client and reactively decreasing it if the provisioned throughput is not enough. Early performance numbers show an increase in throughput after this change. For example, in a container provisioned with 300,000 RU/s, we are now able to insert 4.8 million documents in 2 minutes versus 4.3 million before (almost 20% more on the same time).

You can dig into all those underlying technical details here.

Azure Cosmos DB Java SDK for SQL API (Java SDK)
Microsoft last month announced that the general availability of Java SDK 4.0 is coming soon and published a couple blog posts on the new offering along with other guidance including:

  • A Quickstart Guide for managing databases, containers and items
  • Additional Sample Code for indexing, stored procedures and Change Feed

A couple weeks later, another blog post detailed the SDK's new Async API.

"Current users of our Java SDK v2 are familiar with our Sync API and may have tried our Java SDK v3 with mixed results," Microsoft said. "We are really excited about our new Java SDK v4 because the performance is much better than our v3 SDK but also because the Java SDK v4 implements both an Async API and Sync API."

The Async API works with Reactive Programming, specifically the Reactor framework to describe an application's logic.

For those who prefer not to mess with the Reactor patterns, the Sync API can be simpler to understand and easier to follow, Microsoft said.

More information can be found in:

About the Author

David Ramel is an editor and writer for Converge360.

comments powered by Disqus


Subscribe on YouTube

Upcoming Events