Necrobious'

Thursday, March 18, 2010

Cassandra, Thrift, and Hackage

Last week, I posted a quick 'hello world' example of inserting into and selecting data out of a Cassandra database. To get this example working, I first needed to download and compile the Thrift compiler, which also ships with a Haskell lib, which was already packaged in the Cabal format, but not uploaded to the Hackage repository, so I posted their Thrift to Hackage.

The second dependency my example has, was the Cassandra interface lib, which is compiled from the interface/cassandra.thrift file included in the cassandra 0.5.1 release.Since this code needs to only be generated once, I packaged them as the cassandra-thrift package, and posted them to Hackage.

Hopefully this helps other Haskell developers get Cassandra code up and running quickly, as we'll no longer need to mess around with thrift to talk to a running Cassandra server.

Next up: We need a better (high level) Cassandra Haskell API built on top of this plumbing... More on that soon.

Cheers,
-kirk

Labels: , , ,

1 Comments:

  • I received this question, however Blogger is preventing me from seeing it. >.<

    "Im starting with Cassandra (but Im not new in Haskell)...
    I would like to know an example about "how to query all names which contains 'w'
    I dont know how to do it. Is it really hard??"

    Good question! I haven't tried doing this with Cassandra yet. For most searching I have been using get_range_slices, where in you would need to supply a SlicePredicate.

    Using:
    SlicePredicate (Just ["name"]) Nothing
    Will pull back all of the "name" columns, from there you can do the "starts with s" filtering in Haskell.. Not Ideal obviously..

    I'll keep looking...

    By Blogger necrobious, at 11:12 AM  

Post a Comment



<< Home