New DataStax Enterprise Drivers Available Now

Datetime:2016-08-23 00:43:39          Topic:          Share

Today, we are thrilled to introduce a new set of DataStax Enterprise Drivers built on top of the widely used open source DataStax drivers for Apache Cassandra™ and enhanced to ease the development ofcloud applications powered byDataStax Enterprise.

DataStax Enterprise (DSE) accelerates your ability to deliver real-time value at epic scale by providing a unique always-on architecture. DSE supports mixed workload management with itsTransactional,Search, andAnalytics components, as well as adaptive data management (multi-model capabilities), with all data (tabular, graph, JSON, and key-value) stored in Cassandra. This provides developers the distributed, responsive and intelligent foundation needed to build and runcloud applications.

With the new DataStax Enterprise Drivers, developers will benefit from a unified and cohesive development experience when using the adaptive data management and mixed workload capabilities provided in DataStax Enterprise 5.0 in order to build incredibly fast, continuously available and distributed applications.

DataStax Enterprise Drivers for C#, Java, Node.js, Python (with more to follow shortly) are available now. Full disclosure, while the source code for the DataStax Enterprise Drivers is published on GitHub,the license of these drivers allows their usage only in conjunction with the use of DataStax Enterprise software.  Read on to learn more about what’s new, when and how to upgrade, and the support provided for DataStax Enterprise Graph .

What’s New

DataStax Enterprise Drivers rely on the latest version of our drivers for Cassandra to provide full compatibility with Apache Cassandra 3.0 while also maintaining compatibility with previous versions. Additionally, they feature support for the new unified authentication and also geospatial types introduced in DataStax Enterprise 5.0:

// Unified authentication
import com.datastax.driver.dse.auth.DseGSSAPIAuthProvider;

DseCluster dseCluster = DseCluster.builder()
        .addContactPoint("127.0.0.1")
        .withAuthProvider(new DseGSSAPIAuthProvider())
        .build();

// Geospatial types
import com.datastax.driver.dse.geometry.Point;

Row row = dseSession.execute("SELECT coords FROM points_of_interest WHERE name =
'Eiffel Tower'").one();
Point coords = row.get("coords", Point.class);

dseSession.execute("INSERT INTO points_of_interest (name, coords) VALUES (?, ?)",
        "Washington Monument", new Point(38.8895, 77.0352));

Last, but definitely not least, DataStax Enterprise Drivers have added support forDSE Graph, which is covered in detail below.

When to Upgrade

You want to upgrade to the new DSE drivers if:

  1. You want to take full advantage of the new features introduced in DataStax Enterprise 5.0.
  2. You plan to use DataStax Enterprise Graph for learning or building exciting new cloud applications that use graph. DataStax Enterprise Drivers expand the familiar query API to supportGremlin queries.

How to Upgrade

Upgrading to the DataStax Enterprise Drivers should be a fairly painless process:

  1. Pull the new dependency through your favorite dependency manager. The new drivers are available through the usual channels: Nuget, Maven, Npm, pip, etc.
  2. Update the corresponding imports and the initialization of cluster and session to use DseCluster and DseSession :
// old code
import com.datastax.driver.Cluster;
import com.datastax.driver.Session;

Cluster cluster = null;
try {
   cluster = Cluster.builder()
           .addContactPoint("127.0.0.1")
           .build();
   Session session = cluster.connect();

   Row row = dseSession.execute("select release_version from system.local").one();
   System.out.println(row.getString("release_version"));
} 
finally {
   if (cluster != null) cluster.close();
}

// new code
import com.datastax.driver.dse.DseCluster;
import com.datastax.driver.dse.DseSession;

DseCluster dseCluster = null;
try {
   dseCluster = DseCluster.builder()
           .addContactPoint("127.0.0.1")
           .build();
   DseSession dseSession = dseCluster.connect();

   Row row = dseSession.execute("select release_version from system.local").one();
   System.out.println(row.getString("release_version"));
} 
finally {
   if (dseCluster != null) dseCluster.close();
}

If you are not yet using the latest version of the DataStax drivers for Apache Cassandra, there might be other changes. The following links should provide you with all the necessary details for upgrading:

DataStax Enterprise Graph Support

DSE Graph Gremlin queries are routed intelligently inside the DSE cluster with query results oftentimes differing from the standard tabular format of standard CQL queries. We have enhanced the API exposed through the drivers to work seamlessly with both CQL and DSE Graph while maintaining a coherent API and providing the same level of smart features underneath that you’ve gotten used to (e.g. connection pooling, smart request routing, retry policies, etc.)

To give you a glimpse at how easy it is to work with Gremlin through the DataStax Enterprise Drivers, check out the sample code below:

GraphNode r = dseSession.executeGraph("g.V().hasLabel('test_vertex')").one();
Vertex vertex = r.asVertex();

You’ll find more details about using DSE Graph with the DataStax Enterprise Drivers in theofficial docs.

A Coherent Set of Features and API in the DataStax Drivers for Apache Cassandra and DataStax Enterprise

Before closing, it’s worth emphasizing that while all the code snippets included in this article are in Java, you’ll find the other drivers exposing a similar API which remains consistent with the API and features we have provided through our drivers for Apache Cassandra. And yes, we will continue to develop and improve the drivers for Apache Cassandra as they represent the core building blocks on which DataStax Enterprise Drivers are built.

We look forward to learning about the amazingly smart cloud applications you are building using DataStax Enterprise and how the new DataStax Enterprise Drivers are helping you. Please leave a comment with your feedback or questions.