Hi there! After a long time of laziness I came back to write something about what I’ve done during this time of absence apart from my holidays. And BTW happy new year!
In the last year I’ve been working quite a lot with Cassandra, always using the official Java Driver supported by DataStax, the company behind the database. And I remember that I’ve searched before for a Scala driver and reactive if it was possible and I found only one but not very good to me at that moment. The thing is during this week I was challenged to create a program to basically query some of our Cassandra tables by exposing a REST API, so I started looking for a cool Scala driver.
Starting by simply type “scala cassandra driver” in Google these are the first four results:
First a reactive type-safe driver, second a Scala wrapper of the official Java driver, third the official web site driver list and last a Stack Overflow topic about it.
WORKING WITH PHANTOM
So I decided to give Phantom a chance because it has a high activity on GitHub, it is an open source driver and I think the DSL is pretty good. However I found a few problems trying to start working with; a basic thing like getting a connection to the database using username/password authentication is not supported by the DSL. And after research for a while I found that a lot of good features are only present in the commercial version.
That’s why after getting the problem mentioned above I kept searching for more Scala drivers and summing up this is the list:
- scala-cassandra: just a wrapper around the official Java driver. Last activity on GitHub 2 years ago.
- cascal: one of the drivers mentioned in the official DataStax driver list apart from Phantom. Last activity on GitHub 3 years ago.
- cassie: developed by Twitter. Last activity on GitHub 3 years ago.
- scqla: lack of design, no DSL. Last activity on GitHub 2 years ago.
As you can see all of this projects are no longer maintained, so once again I came back to Phantom trying to make it work.
PHANTOM SSL EXTENSION
After a few hours trying to get a connection using Phantom, including opening an issue (hopefully I’ll get a response soon), I created a project to share my workaround solution which I called phantom-ssl-extension, mainly intended to work with Java 8.
It consists on the creation of a CustomSessionProvider mixing Phantom with the official Java driver and a few util functions. I invite you to check the example out in order to see how it works and I hope you had enjoyed this short research post.
Until next time!