Is there a stable Cassandra library for Erlang?
Is there a s开发者_如何学Gotable Cassandra library for Erlang? I can't seem to find one
I faced the same issue. After benchmarking most of all Cassandra drivers available I've decided to start a new driver Erlcass based on datastax cpp driver.
The datastax cpp driver has incredible performances and it's fully async.
From my tests on a cluster where other erlang drivers couldn't reach more than 10k reads/second with datastax one I was able to get over 60k/s.
There is a slightly difference between the Datastax driver and Erlcass but still I was able to reach over 50k reads/s in the same scenarios.
Most of overhead is coming from converting the data into erlang terms and the other way around.
It's work in progress to improve the interface and performances. Currently non prepared statements needs some changes.
Apache Cassandra uses Thrift. So all you need to do is to generate the thrift binding for Erlang (thrift --gen erl interface/cassandra.thrift
)
From the Apache Thrift wiki:
Thrift has generators for C++, C#, Erlang, Haskell, Java, Objective C/Cocoa, OCaml, Perl, PHP, Python, Ruby, and Squeak
(If you are looking for a more "high level client" library then I dont know.)
I've written a simple Cassandra erlang client. Check it out! https://github.com/lpgauth/cassanderl
According to the video by Eric Evans you should avoid using Cassandra throught the Thrift API if you can possibly do so.
精彩评论