CompanySeptember 11, 2014

Introducing the DataStax Node.js driver for Cassandra

Introducing the DataStax Node.js driver for Cassandra

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.

Discover more
ReleasesDrivers
Share
JUMP TO SECTION

Getting started

One-stop Data API for Production GenAI

Astra DB gives JavaScript developers a complete data API and out-of-the-box integrations that make it easier to build production RAG apps with high relevancy and low latency.