Back to Blog

Introducing the DataStax Node.js driver for Cassandra

date: September 11, 2014

The DataStax Node.js driver for Apache Cassandra is finally here!
We just released the first beta of the driver:

The driver is built on top of my previous driver, we used the knowledge and the existent codebase as a base to deliver a new driver with high level features that are present on the other DataStax drivers for Cassandra:

  • Automatic node discovery
  • Simple, prepared and batch statement support
  • Load balancing policies
  • Failover with retry and reconnection policies
  • SASL auth support

The driver is built to be tunable: the default behavior of the driver can be changed or fine tuned by using tuning policies and connection options.

The public API of the driver shares most of the same names with the Java/C# counterparts, for example you will find the datacenter-aware load balancing policy under cassandra.policies with the name DCAwareRoundRobinPolicy, with the same constructor arguments and behavior.
Also, some internal classes, such as the RequestHandler, have the same behavior and responsibility (context, retry, failover) as their counterparts.

The development effort to provide an up to date, high performance, fully featured Node.js Driver for Apache Cassandra will continue on this project, while node-cassandra-cql will be discontinued.

Getting started


var cassandra = require('cassandra-driver');
var client = new cassandra.Client({ contactPoints: ['127.0.0.1'], keyspace: "ks1"});
client.execute('SELECT name, email FROM users where key=?', ['mick-jagger'], function (err, result) {
  var user = result.rows[0];
  //The row is an object with the column names as property keys
  console.log("Hello %s, your email is %s", user.name, user.email);
});

Check out the getting started guide for more code samples.

There are exciting new features coming, so join the driver mailing list and follow us on twitter: @jorgebg@mfiguiere and @al3xandru.

Subscribe to Our Blog Now

Thank You for Signing Up!