email iconemail phone iconcall

Ruby Driver 1.0 GA release

By Bulat Shakirzyanov -  November 19, 2014 | 1 Comment

I'm very happy to announce that the DataStax Ruby Driver 1.0 GA for Apache Cassandra and DataStax Enterprise has just been released. It has been an exciting journey, and it is only the beginning, please refer to the complete changelog for details.

Installation

You can install the driver now using RubyGems:

gem install cassandra-driver

Or Bundler:

gem 'cassandra-driver', '~> 1.0'

Quick start

Here is an quick look at using the driver:

require 'cassandra'

cluster = Cassandra.cluster # connects to localhost by default

cluster.each_host do |host| # automatically discovers all peers
  puts "Host #{host.ip}: id=#{host.id} datacenter=#{host.datacenter} rack=#{host.rack}"
end

keyspace = 'system'
session  = cluster.connect(keyspace) # create session, optionally scoped to a keyspace, to execute queries

future = session.execute_async('SELECT keyspace_name, columnfamily_name FROM schema_columnfamilies') # fully asynchronous api
future.on_success do |rows|
  rows.each do |row|
    puts "The keyspace #{row['keyspace_name']} has a table called #{row['columnfamily_name']}"
  end
end
future.join

Features

The DataStax Ruby Driver 1.0 for Apache Cassandra and DataStax Enterprise includes the following features:

Compatibility

This driver works exclusively with the Cassandra Query Language v3 (CQL3) and Cassandra's native protocol, and supports the following software versions:

  • Apache Cassandra 1.2 and 2.0
  • DataStax Enterprise 3.1, 3.2, 4.0 and 4.5
  • Ruby (MRI) 1.9.3, 2.0 and 2.1
  • JRuby 1.7
  • Rubinius 2.2

Useful links

Finally, celebrate this release with a screencast detailing load balancing in the Ruby Driver.

Happy Coding!









DataStax has many ways for you to advance in your career and knowledge.

You can take free classes, get certified, or read one of our many white papers.



register for classes

get certified

DBA's Guide to NoSQL







Comments

  1. grejon says:

    I tried the instructions above, but the require fails with a load error. Ruby 2.0, Rails 4.1.6, Cassandra 2.0.11.

    irb(main):003:0* require ‘cassandra’
    LoadError: cannot load such file — cassandra_murmur3
    from /usr/local/share/gems/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require’
    from /usr/local/share/gems/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `block in require’
    from /usr/local/share/gems/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency’
    from /usr/local/share/gems/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require’
    from /usr/local/share/gems/gems/cassandra-driver-1.0.0/lib/cassandra.rb:503:in `’
    from /usr/local/share/gems/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require’
    from /usr/local/share/gems/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `block in require’
    from /usr/local/share/gems/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:232:in `load_dependency’
    from /usr/local/share/gems/gems/activesupport-4.1.6/lib/active_support/dependencies.rb:247:in `require’
    from (irb):3
    from /usr/local/share/gems/gems/railties-4.1.6/lib/rails/commands/console.rb:90:in `start’
    from /usr/local/share/gems/gems/railties-4.1.6/lib/rails/commands/console.rb:9:in `start’
    from /usr/local/share/gems/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:69:in `console’
    from /usr/local/share/gems/gems/railties-4.1.6/lib/rails/commands/commands_tasks.rb:40:in `run_command!’
    from /usr/local/share/gems/gems/railties-4.1.6/lib/rails/commands.rb:17:in `’
    from bin/rails:4:in `require’
    from bin/rails:4:in `’irb(main):004:0> exit

Comments

Your email address will not be published. Required fields are marked *




Subscribe for newsletter: