Does anyone have advice on using cassandra with scala? There is no native scala-cassandra client supporting cassandra version 8.0+, so I have to use hector, and it seems to work OK but not to be concise. Do you have any attempts, recommendations or any wrapper code,.. etc for hector ?
5 Answers
The official Scala driver for Apache Cassandra and Datastax Enterprise, with full support for CQL 3.0, is phantom.
Phantom was developed at Outworkers, official Datastax partners, explicitly to superseed all other drivers. It's being actively developed and maintained, with full support for all the newest Cassandra features.
Disclaimer: I am the project lead on phantom, and a result may be possibly biased in my recommendation. We offer more in depth feature comparisons on the phantom wiki.

- 28,161
- 11
- 65
- 105
-
6in 2015 this should be the right answer, no active dev in the other tools – Ismail Marmoush Oct 21 '15 at 17:40
-
1Not really sure what makes this driver "official", and it would be worth noting the author's bias here since he's the maintainer. I have no opinion about whether phantom is good or not, though. – David van Geest Jan 12 '18 at 19:20
-
3The 5 continuous years of our time and work invested into it and working with Datastax without making any money at all, and the will power to deal with comments like yours, after all that. – flavian Jan 13 '18 at 16:49
-
1Sorry mate but I agree with the previous comment. No need to get snippy and I think it's a fair question which you don't actually address in your comment. What exactly makes phantom the "official scala driver"? I understand you say you invested work into it and you say you made no money, but, that doesn't make something official. – MORCHARD Jun 04 '19 at 19:30
-
@MORCHARD Fair enough, use whatever you like then. – flavian Jun 12 '19 at 11:30
Cassie is "A Scala client for Cassandra": https://github.com/twitter/cassie. According to twitter's dev block it was released on 2012-02-09, after the initial answer to this question.
https://wiki.apache.org/cassandra/ClientOptions also lists Cascal which I think is older than Cassie.

- 66
- 1
- 3
-
3Cascal's founder has decided to stop developing it. I like Cascal's grammar, but I think Cassie maybe the better replacement, since it is developed by Twitter team. – Feb 27 '12 at 15:19
-
Have you looked at the classes in the template package? They may make your wrapper more concise. We have a quick how-to on the wiki: https://github.com/rantav/hector/wiki/Getting-started-%285-minutes%29

- 1,898
- 13
- 12
Two popular client-drivers are Quill and Phantom. They both use Datastax underneath. I did a load test profiling of a simple json GET/POST using play for both. You can see the side-by-side comparisons of results in the projects under root/loadtest/phantom|quill/results.
Might help you better to choose a driver.
https://github.com/yleun/cassandra-loadtest
Cassandra 3.10 scala 2.11.8 phantom 2.6.4 quill 1.2.1

- 169
- 1
- 3
Intro
As previous answers suggested Scala based clients for Cassandra are:
However, they both are internally based on Datastax Java Driver.
Personally, I did not like either of them and Java Driver felt much more natural and simple. On the other hand, those libraries created some overhead on top of it, so performance-wise they are always inferior.
Java Driver Scala Integration
I have found some articles (example) showing how you could integrate Java Driver better with Scala and it did not look hard.
The result is my own library that you can find on GitHub: https://github.com/atais/scassandra
It allows for seamless integration in Scala for both CQL
queries and manipulating the ListenableFuture
without mapping it into scala.Future
.
Enjoy :)

- 10,857
- 6
- 71
- 111