cassandra-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Edward Capriolo <edlinuxg...@gmail.com>
Subject Introducing farsandra: A different way to integration test with c*
Date Wed, 22 Jan 2014 15:06:14 GMT
The repo:
https://github.com/edwardcapriolo/farsandra

The code:
   Farsandra fs = new Farsandra();
    fs.withVersion("2.0.4");
    fs.withCleanInstanceOnStart(true);
    fs.withInstanceName("1");
    fs.withCreateConfigurationFiles(true);
    fs.withHost("localhost");
    fs.withSeeds(Arrays.asList("localhost"));
    fs.start();

The story:
For a while I have been developing applications that use Apache Cassandra
as their data store. Personally I am more of an end-to-end test person then
a mock test person. For years I have relied heavily on Hector's embedded
cassandra to bring up Cassandra in a sane way inside a java project.

The concept of Farsandra is to keep Cassandra close (in end to end tests
and not mocked away) but keep your classpath closer (running cassandra
embedded should be seamless and not mess with your client classpath).

Recently there has been much fragmentation with Hector Asytanax, CQL, and
multiple Cassandra releases. Bringing up an embedded test is much harder
then it need be.

Cassandra's core methods get, put, slice over thrift have been
wire-compatible from version 0.7 - current. However Java libraries for
thrift and things like guava differ across the Cassandra versions. This
makes a large number of "issues" when trying to use your favourite client
with your 1 or more versions of Cassandra. (sometimes a thrift mismatch
kills the entire integration and you (CANT)! test anything.

Farsandra is much like https://github.com/pcmanus/ccm in that it launches
Cassandra instances remotely inside a sub-process. Farsandra is done in
java not python, making it easier to use with java development.

I will not go and say Farsandra solves all problems. in fact it has it's
own challenges (building yaml configurations across versions, fetching
binary cassandra from the internet), but it opens up new opportunities to
developer complicated multi-node testing scenarios which are impossible due
to re-entrant embedded cassandra code!

Have fun.

Mime
View raw message