Search code examples
cassandraspring-data-cassandra

Cassandra java client


I would like to use cassandra for my use case and searching java client for it. I found many java interfaces for cassandra along with Spring data cassandra. I have been using spring from many years. I would like to know spring data cassandra vs Astyanax in terms of performance and features.


Solution

  • When choosing a Cassandra driver, one of the more important aspects to consider is which protocol it uses at its core. Astyanax uses Thrift, and Spring uses the new CQL3 binary protocol.

    Why is this important?

    Cassandra 2.1 brought some significant performance gains in terms of the CQL3/binary protocol vs. the original Thrift protocol. I have used Astyanax before (2 years ago), and at the time it had some significant improvements over Hector. But the newer CQL3-based drivers are much easier to use. And now that they also out-perform the Thrift-based drivers, the choice has become much easier.

    So given the choice between Astyanax and Spring, I would choose Spring.

    Honestly though, if you are starting a new project you should consider the DataStax Java Driver. It is also CQL3/binary based, and the latest version has some usability improvements like an Object-mapping API that greatly simplifies basic CRUD operations. And you simply cannot go wrong by using a DataStax supported driver.