Xandra – Fast, simple, and robust Cassandra driver

Hey all,

earlier today @lexmag and I released the first version of Xandra, a Cassandra driver built natively in Elixir. We’re very excited and we hope you’re gonna enjoy it!

Andrea and Aleksei

18 Likes

Hi everyone,

Recently we have released new version of the driver that supports clustering.

Right now we use it in all components of the push notification system mentioned in the “The Pursuit of Instant Pushes” article.
Using Xandra resulted in 30% boost in push notification delivery time.

Aleksei and Andrea

7 Likes

Quick update: we just released v0.4.0 of the driver, which supports retry strategies to retry failed queries. Exciting times!

Andrea and Aleksei

5 Likes

Since the last update we have released few more versions of the driver (v0.7 is the most recent) with great changes:

  • Support for date, time, smallint, and tinyint types
  • Support for user-defined types
  • Support for authentication
  • Important encoding and decoding optimisations (around 35% speedup)

:rocket:

3 Likes

Hey folks,

we released version v0.9.0 of Xandra which adds native support for datetime data types and optimizes decoding even more. If you’re interested you can check out the full CHANGELOG.

4 Likes

Hi!

Thanks for the library, @whatyouhide @lexmag!

Have you considered using other libraries before writing your own, for example, lpgauth/marina?
Was it a lack of features that made you write your own or maybe something else?

I’m trying to pick a library to use to interface with scylladb, and there are just too many choices …

Heyo, we used cqerl initially but we were not satisfied with it because of performance, maintainability, documentation, and the poor error messages it kept spitting out. I was not aware of marina personally but I bet @lexmag was, but we went with our own to have 1. a pure Elixir solution 2. based on DBConnection (which in turn means great and extensible pooling) which could 3. be fast, modern, and extensible.

Also, since you’re mentioning scylladb, it would be awesome if you ended up trying Xandra with it and could report if everything works fine. In case you do end up trying them together, please take the time to clone the source code for Xandra and run the Xandra test suite against ScyllaDB :slight_smile: Related: https://github.com/lexhide/xandra/issues/112.

2 Likes

Hey!

We have indeed considered existing libraries before writing our own. Best options were CQErl and marina.

As @whatyouhide said, we went with CQErl to have our project moving forward.
Though its performance was far from desired for our use case, error messages that come from internals did not help, its dependency configuration was extremely painful: Git instead of Hex (we even discovered that one the dependencies changes actual Git ref during Makefile execution—what you see is not what you get). In fact, we end up with a fork.
We could (and were considering to) fix all those aforementioned issues, but that amount of work would mean that we are basically writing a new driver. Also it felt that starting from scratch will be faster to get things done.

Marina seems alright (still Git dependencies though). However it lacks some substantial features, batch queries in our case.

The day we switched to Xandra we got minimum 30% performance improvement and were able to simplify the code around error handling.
Since then Xandra received many optimizations (~35% faster decoding, for example), native support for calendar data types, and streaming functionality out of the box.

5 Likes