Thursday, August 23, 2012

Cassandra APIs : The Laundry List

We had a question come across the mailing list regarding the available Java APIs.  That spawned the following post.  These are the Cassandra APIs I'm aware of.  Below commentary is entirely subjective and based solely on my experiences with the APIs, which in some cases was limited.  If I've missed any, please let me know.  This can be an organic blog entry that we'll eventually move to some place more official.

So, FWIW...

Cassandra APIs

  • Java

  • Hector (Production-Ready)
    • The most stable of the Java APIs, ready for prime-time.
  • Astyanax (The Up and Comer)
    • A clean Java API from Netflix.  It isn't as widely used as Hector, but it is solid.  In some of our uses, we've swapped out Hector for Astyanax.
  • Kundera (The NoSQL ORM)
    • JPA compliant, this is handy when you want to interact with Cassandra via objects.  This constrains you somewhat in that you won't be able to have dynamic number of columns/names, etc.  But it does allow you to port over ORMs, or centralize storage onto Cassandra for more traditional uses.
  • Pelops 
    • I've only used Pelops briefly.  It was a straight forward API, but didn't seem to have the momentum behind it. 
  • PlayORM (ORM without the constraints?)
    • I just heard about this one (Thanks for the pointer Dean).  It  looks like it is trying to solve the impedance mismatch between traditional JPA-based ORMs and NoSQL by introducing JQL.  It looks promising.
  • Spring Data Cassandra (Entirely Proof of Concept!)
    • We're big Spring-heads.   We use Spring Data elsewhere in our system.  There was a MongoDB implementation, but alas no Cassandra implementation.  To get consistency across our DAO layer, we decided to start work on the Spring Data Cassandra implementation.  Still a work in progress.
  • Thrift (Avoid Me!)
    • This is the "low-level" API.  I almost consider it the internal API/protocol for Cassandra.  Avoid using thrift directly unless you have cause to do so.
  • REST
  • Virgil  (Our Baby)
    • Built on Dropwizard, we use Virgil for loosely coupled integrations between systems.  It is also a simple way to get newbies up and running (firing curl's at the DB).  We also use it for Ruby/Cucumber integration.
  • restish
    • Not sure if this one is still maintained, but I wanted to include it for completeness. (and as not to appear biased)
  • Python
  • Pycassa (The only game in town?)
    • As far as I know, this is *the* python API for Cassandra.  Please let me know if there are others worth considering.
  • PHP
  • PHPcassa (Been around the block and back)
    • Another rock solid library that's been in the game for a while. This is your best bet in the PHP world.
  • Ruby
  • Ruby Gem 
    • I use this to create small little scripts for ETL, etc.  I had some trouble when I tried to use it for substantial jobs, which is why we fell back and decided to use the REST API instead.
    • http://www.engineyard.com/blog/2009/cassandra-and-ruby-a-love-affair/
  • Node.js
    • Node-cassandra-client
      • A node.js client released by Rackspace.
      • http://www.rackspace.com/blog/rackspace-contributes-cassandra-cql-driver-for-node-js/
  • Perl 

No comments: