You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Wolfgang Vogl <ao...@aon.at> on 2011/12/15 12:13:08 UTC

Using Cassandra in Rails App

Hi,

I have a couple of questions about working with Ruby on Rails and Cassandra.

 

What is the recommended way of Cassandra integration into a Rails app ?

active_column

cassandra-cql

some other gems?

 

Is there any reference implementation? 

some projects on github that are using the gems?

 

Regards,

Wolfgang


Re: Using Cassandra in Rails App

Posted by Jeremy Hanna <je...@gmail.com>.
Traditionally there are two places to go.  Twitter's ruby client at https://github.com/twitter/cassandra or the newer cql driver at http://code.google.com/a/apache-extras.org/p/cassandra-ruby/.  The latter might be nice for green field applications but CQL is still gaining features.  Some people also use hector via jruby afaik.  Brian O'Neill also has the rest based server that he mentioned in this thread.

A recent presentation that talks about ruby with cassandra is here: http://www.slideshare.net/tylerhobbs/cassandra-for-rubyrails-devs

On Dec 15, 2011, at 5:13 AM, Wolfgang Vogl wrote:

> Hi,
> I have a couple of questions about working with Ruby on Rails and Cassandra.
>  
> What is the recommended way of Cassandra integration into a Rails app ?
> active_column
> cassandra-cql
> some other gems?
>  
> Is there any reference implementation?
> some projects on github that are using the gems?
>  
> Regards,
> Wolfgang


Re: Using Cassandra in Rails App

Posted by Aaron Turner <sy...@gmail.com>.
On Thu, Dec 15, 2011 at 3:13 AM, Wolfgang Vogl <ao...@aon.at> wrote:
> Hi,
>
> I have a couple of questions about working with Ruby on Rails and Cassandra.
>
>
>
> What is the recommended way of Cassandra integration into a Rails app ?
>
> active_column
>
> cassandra-cql
>
> some other gems?
>
>
>
> Is there any reference implementation?
>
> some projects on github that are using the gems?

Depends on what you're trying to use Cassandra for with Rails.  In my
project we're using a SQL DB for meta data and Cassandra as our heavy
lifting datastore for time series data.  After looking at the
available Ruby drivers a few months ago (things have changed since
then btw), I decided to go with JRuby + Hector. This fit in well with
some other requirements I had which JRuby was a great fit (like real
threads) and TorqueBox as my application server.

Due to how my data is stored, it didn't really matter if I used
Hector, CQL or ActiveRecord, I was going to need to write an
abstraction layer on top to make it easier to store & retrieve data.
And using Hector meant I was using one of the most mature, stable and
tested libraries for accessing Cassandra.

My project is big enough that not everything is done in RoR... there
are some cron jobs as well doing some Map/Reduce like jobs as well.
This is where JRuby+Hector really shines since for high performance
you really need your client to be multi-threaded since the single
threaded performance of Cassandra isn't anything to write home about.

Anyways, I'm not sure I would recommend JRuby+Hector if this is the
only reason you'd use JRuby over MRI, but if you might find the
plethora of Java libraries useful it's definitely worth looking into.

-- 
Aaron Turner
http://synfin.net/         Twitter: @synfinatic
http://tcpreplay.synfin.net/ - Pcap editing and replay tools for Unix & Windows
Those who would give up essential Liberty, to purchase a little temporary
Safety, deserve neither Liberty nor Safety.
    -- Benjamin Franklin
"carpe diem quam minimum credula postero"

Re: Using Cassandra in Rails App

Posted by Brian O'Neill <bo...@alumni.brown.edu>.
I'm not sure this is the best answer, but all of our webapps (RoR included)
access Cassandra via REST.

That is one of the major reasons we built Virgil.
http://code.google.com/a/apache-extras.org/p/virgil/

It allows us to build the webapps, for the most part, independent of the
actual storage mechanism.
(Couch, Mongo, Cassandra, etc.)

Accessing REST services with Ruby is so clean (using rest-client gem) that
you can get to most data elements in just a couple lines.  It also enabled
simple browser-side/javascript fetches of data (so we didn't have to take a
round-trips through MVC for simple data retrieval).  REST is the new JDBC.
;)

-brian


On Thu, Dec 15, 2011 at 6:13 AM, Wolfgang Vogl <ao...@aon.at> wrote:

> Hi,****
>
> I have a couple of questions about working with Ruby on Rails and
> Cassandra.****
>
> ** **
>
> What is the recommended way of Cassandra integration into a Rails app ?***
> *
>
> active_column****
>
> cassandra-cql****
>
> some other gems?****
>
> ** **
>
> Is there any reference implementation? ****
>
> some projects on github that are using the gems?****
>
> ** **
>
> Regards,****
>
> Wolfgang****
>



-- 
Brian ONeill
Lead Architect, Health Market Science (http://healthmarketscience.com)
mobile:215.588.6024
blog: http://weblogs.java.net/blog/boneill42/
blog: http://brianoneill.blogspot.com/