The Cassandra Data Model – Another Gratuitous Introduction

I recently had a conversation in #cassandra about the Data Model that I thought might be useful to try to distill into a few lines. These few lines ignore all of the implementation details to make it work in practice but it gives you the starting point. It looks a little something like this …

Continue Reading →

Read full story · Comments { 0 }

Cassandra-cql ruby gem for Cassandra 1.0

Cassandra-cql has been updated for the latest version of cassandra. It supports all of the datatypes and has proper encoding support for ruby 1.9. It is also now published as a gem so a simple ‘gem install cassandra-cql’ should get you ready to roll with Ruby and Cassandra.

The official location for the code is now Google Code but I also use the Cassandra-CQL github repo if you want to participate that way. For a quick introduction on usage, check out the Google Code Wiki.

Enjoy!

Read full story · Comments { 0 }

Cassandra-CQL, a Ruby CQL client for Cassandra

Cassandra Query Language (CQL)

Cassandra originally went with a Thrift RPC-based API as a way to provide a common denominator that more idiomatic clients could build upon independently. However, this worked poorly in practice: raw Thrift is too low-level to use productively, and keeping pace with new API methods to support (for example) indexes in 0.7 or distributed counters in 0.8 is too much for many maintainers.

CQL, the Cassandra Query Language, addresses this by pushing all implementation details to the server; all the client has to know for any operation is how to interpret “resultset” objects. So adding a feature like counters just requires teaching the CQL parser to understand “column + N” notation; no client-side changes are necessary.
Continue Reading →

Read full story · Comments { 0 }

FFI Ruby Bindings for Phidget Library

While working with completely virtualized systems and architectures is fun, for me it’s never been quite as much fun as doing things in the Real World™. A few years ago I found Phidgets Inc. Phidgets are a set of “plug and play” building blocks for low cost USB sensing and control from your PC. From their website:

All the USB complexity is taken care of by our robust API. Applications can be developed quickly by programmers using their favorite language: C/C++, C#, Cocoa, Delphi, Flash AS3, Flex AS3, Java, LabVIEW, MATLAB, Max/MSP, MRS, Python, REALBasic, Visual Basic.NET, Visual Basic 6.0, Visual Basic for Applications, Visual Basic Script, and Visual C/C++/Borland.NET.

Unfortunately, there is one language that is absent from this list: Ruby.

Several years ago, there was an effort started by Craig DeHaan and later picked up by Kit Plummer which worked pretty well but the callbacks seemed a little fragile and I wanted the interface to be a little more idiomatically Ruby. Also, using FFI means it works on multiple Ruby VMs without issue, MRI, JRuby, etc. Like the previous libraries, there aren’t many devices supported yet but that’s just a matter of having them. There are traditional and idiomatic examples in the repository and it can be installed with everybody’s favorite command: gem install phidgets-ffi.

The source and additional documentation can be found at https://github.com/kreynolds/phidgets-ffi. Enjoy :)

Read full story · Comments { 0 }

Basic Time Series with Cassandra

editors note: as of 7 Mar 2012, this info is still current and correct.

One of the most common use cases for Cassandra is tracking time-series data. Server log files, usage, sensor data, SIP packets, stuff that changes over time. For the most part this is a straight forward process but given that Cassandra has real-world limitations on how much data can or should be in a row, there are a few details to consider.

Continue Reading →

Read full story · Comments { 7 }