1. cql-rb v2.0 released!

    cql-rb v2.0 has finally been released. This is the first release to support all the new features in Cassandra 2.0 like result paging, mixed batches, SASL authentication.

    Read the full release notes on v2.0

    The next step is to add LZ4 compression support – it’s already completed, but the lz4-ruby gem didn’t release a compatible version in time to include it in v2.0, and there will be support for connection strategies, routing strategies, and hopefully support for encrypted connections, as well as support for the new features that will be introduced in Cassandra 2.1.

    This release is forwards compatible with all versions of Cassandra that support v2 of the CQL binary protocol, which includes Cassandra 2.1 and most likely all releases in the coming year or two.

  2. cql-rb v2.0 release candidate

    It’s been way too long in the making, but v2.0 of cql-rb is very nearly here. I released the first release candidate yesterday, and the final version should be released this week.

    The reason it has taken so long is twofold: first I wasn’t sure enough that I’d found all the bugs, but didn’t have the time to take it through the process I usually use before releasing a version, and after I had come that far I wanted to be sure about the public API.

    What I do to satisfy myself that a new version is completely stable and reasonably bug free is a blog post I’ve been meaning to write for a while, but suffice to say that I don’t take it lightly. v2.0 is a big release, there’s a ton of new code and feature support, and lots of things have had to changed to accommodate supporting two protocol versions at the same time. The code that does the initial connection and peer discovery was also heavily refactored, it’s by far the most complex part of the driver, but now it’s at least possible to understand it again. Being confident that you’ve weeded out most of the bugs after such a big change requires more than just some integration tests.

    Since bumping the version to a new major means the possibility of making backwards incompatible changes I also wanted to make sure I took full advantage of that and removed things I didn’t want to support, dropped deprecated features, and changed things I wasn’t too happy about. In the end I decided on keeping the API backwards compatible with v1.2, and just remove the deprecated features from the documentation. Some pieces that may have accidentally been in the public API documentation have also been marked as private.

    Once v2.0 is released I will start working on new features, and I should probably get going on supporting Cassandra 2.1 features like user defined types.

  3. cql-rb gets a little sister

    cql-rb v2.0.0.pre1 has just been released, it’s the first version with an external dependency.

    Before I tell you more I want to give you some background about why cql-rb has until now been completely standalone: When I started cql-rb I was hoping to use some existing gems for things like futures, IO, byte buffers, UUIDs, etc., but I didn’t find any that fit.

    Read More

  4. First prerelease of cql-rb v2.0

    It’s been long in the making, but now you can get full Cassandra 2.0 support with cql-rb. Including batches, paging, SASL authentication and bound variables in non-prepared statements.

    gem install cql-rb -v 2.0.0.pre0

    You can find the release notes on GitHub.

  5. Practical Cassandra and cql-rb

    The new Cassandra book Practical Cassandra has five pages with examples of how to use cql-rb!

    The chapter “Drivers and Sample Code” shows how to use Datastax’ Java, C# and Python drivers, and cql-rb.

  6. cql-rb v1.2.0 released

    cql-rb, the Cassandra driver for Ruby, just reached v1.2.0 and is now feature complete with respect to the v1 of the CQL binary protocol.

    It’s been about a year since I set out to build a new, high performance, Ruby driver for Cassandra. v1.0 was released eight months ago and was about delivering the bare necessities with great performance. v1.1 followed a few months later and had everything you could expect from a driver for a distributed database. v1.2 is a tiny release in comparison to those two, but wraps up the feature set with support for request tracing and compression.

    The the goal posts always move, as it were. Cassandra 2.0 came out in September with lots of new features. The next release of cql-rb, besides bug fixes and performance improvements, will also be 2.0. We’ll have to see if Cassandra 2.1 comes out before, but the idea is not to have synchronized version numbers, I just think that it will be a significant number of changes and new features and a major release seems appropriate.

    The plan is to do a release with support for all of the features of v2 of the CQL binary protocol, including batching, bound variables for non-prepared statements, result set paging, and support for SASL authentication. The new version also opens up some great new optimization possibilities. Keep a look out for the prereleases, but if you can’t wait you can peek at the protocol_v2 branch, which already has some of the features mentioned.

  7. Video of my talk on building a CQL driver from Cassandra Summit Europe 2013. You can find the slides here, and the videos for the other talks from the conference can be found on YouTube.

    Sorry about the lack of light, I turned down the lighting in the room to make sure my slides would be readable — it looks like it was pitch dark, but it’s mostly the camera focusing on the brightest source of light in the room.

  8. Building a CQL driver

    I was at Cassandra Summit Europe and talked about my experience building a CQL driver. Here are my slides:

    I also took the opportunity to release the first release candidate of cql-rb v1.1, which has automatic reconnection, peer discovery, better performance, especially for prepared statements, and many more improvements. It’s been a long time coming, but it’s among the hardest code I’ve ever had to write.

  9. A new Ruby driver for Cassandra

    For the last months I’ve been working on a driver for Cassandra’s new native protocol, and today I released version 1.0.

    Before 1.2 all Cassandra drivers used Thrift, but in 1.2 a new binary protocol was introduced. The Ruby Thrift libraries have never worked well, especially not in JRuby, and because of that using Cassandra with your Ruby application has never been a great experience. Hopefully that will change now.

    cql-rb is pure Ruby, works with both MRI and JRuby and has no other dependencies. It has support for most of the features of CQL3 and Cassandra 1.2, including prepared statements and authentication. It’s built around a non-blocking IO reactor to make full use of the binary protocol’s support for request pipelining, and maximize performance.

    For version 1.0 the focus has been to support the features needed for most applications, to be stable enough for production and to provide good performance. Now when 1.0 is out I will try to implement some of the more advanced features that exist in Datastax Java driver, for example automatic peer discovery, reconnection on node failures, support for tracing requests and compression.

    Finally, here’s a snipplet to demonstrate basic usage, there are many more examples in the README, and in the API docs.

    require 'cql'
    client = Cql::Client.connect
    result = client.execute('SELECT * FROM peers')
    result.each do |row|
      p row