May 28th, 2014

DataStax C# Driver 2.0 Supporting Apache Cassandra 2.0 is now GA” was created by Jorge Gondra

We are excited to announce the public release of the version 2.0 of the DataStax C# driver for Apache Cassandra and DataStax Enterprise. We added several new features to the driver for this new version:

  • Apache Cassandra 2.0 and DataStax Enterprise 4.0 support
    • Result autopaging
    • Statement batching
    • Lightweight transactions
    • Parameterized statements
  • Task-based async statement execution
  • API improvements: interfaced session and load balancing dependencies.

The What’s new page contains details about all the new features, but I also wanted to provide a couple of examples on how you can use some of these features of the C# driver.

Task-based Asynchronous API

Session provides support for asynchronous execution of statements (for any type of statement: simple, bound or batch) by exposing the ExecuteAsync method that returns a task that can be waited, continued or awaited (if you are running .NET 4.5), simplifying the process of adding parallelism and concurrency to your application.

Automatic pagination of results

If a query yields a very large number of results, only an initial amount of rows will be fetched (according to the page size), the rest of the rows will be fetched “on-demand” as you iterate through the RowSet.

Batching statements

You can execute multiple statements in a batch to update/insert several rows atomically even in different column families, by adding multiple (prepared or unprepared) statements to theBatchStatement and execute it.

We invested time to significantly increase test coverage of the driver and there are now more than 180 unit and integration tests in our repository.

If you are using the version 1.0 of the driver, there is an Upgrade Guide to 2.0 available with a detail of the changes. Note that the while C# 2.0 driver supports the new Cassandra 2.0 features, this new version of the driver works with Apache Cassandra 1.2 and 2.0, and DataStax Enterprise 4.0, 3.2, and 3.1.

The new 2.0 version of the C# Driver is now available on NuGet. Give it a try and let us know what you think!