Skip to content

demmer/node-cassandra-native-driver

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Oct 22, 2015
7a0d904 · Oct 22, 2015
May 27, 2015
Oct 16, 2015
Oct 22, 2015
Oct 12, 2015
Oct 16, 2015
Oct 16, 2015
Dec 30, 2014
Oct 12, 2015
Dec 30, 2014
Dec 31, 2014
Jun 2, 2015
Oct 12, 2015
Oct 22, 2015
Oct 22, 2015

Repository files navigation

node-cassandra-native-driver Build Status: Linux

Node.js addon that wraps the DataStax C++ cassandra driver.

Functionally, this project is similar to [https://github.com/datastax/nodejs-driver] except that it offers better performance due to the fact that the protocol processing is performed in C++ and can thereby leverage other threads instead of just the main loop thread.

Installation

npm install cassandra-native-driver

Features

  • Exposes much of the native driver functionality, including regular, prepared, and batch statements as well as various configuration options.
  • Tuned for high performance, capable of 100,000s of operations per second under some circumstances.
  • Fully parallel execution model, including support for paging results.
  • Asynchronous logging handler that exposes C++ driver logs as Javascript callbacks.
  • Supports most basic cql types, including int, varchar, double, boolean, blob, counter, timestamp including a convenient type based on the Javascript type as well as an API to explicitly select the type.

Basic Usage

var cassandra = require('cassandra-native-driver');
var client = new cassandra.Client(options);
client.connect({address: "10.0.0.1,10.0.0.2"}, function(err) {
    var cql = "SELECT email from profile where username = ?";
    client.execute(cql, 'joe', function(err, results) {
        console.log('got email', results.rows[0]);
    });
}

Documentation

TBD...

License

The wrapper library and addon are licensed for distribution by the MIT License.

This repository also includes a copy of the DataStax C++ driver from https://github.com/datastax/cpp-driver which is covered by the Apache License.

This code has been slightly modified to include conditional compilation directives to enable it to be used within the context of a node.js addon.