Hi all … looking for some advice.
I am looking to use the lau module in conjunction with a module that
talks to nosql cassandra database. A couple of questions:
Does a module exist that can talk to Apache Cassandra NoSQL db? I am
thinking no.
Cassandra uses Apache Thrift as it’s driver / service layer. Using
Thrift you can write in C, but then you have a glib dependency, or I can
code in C++. What do you recommend? Adding the glib dependency or
writing an upstream implementation that talks to a C++ library that is
compatible with C?
Thanks
Chris
P.S. I am planning on making this opensource …
Posted at Nginx Forum:
On Tue, Jan 31, 2012 at 1:50 AM, chrislovecnm [email protected]
wrote:
Hi all … looking for some advice.
I am looking to use the lau module in conjunction with a module that
talks to nosql cassandra database. A couple of questions:
I assume you’re referring to the lua module (I have no idea what lau
module is).
Does a module exist that can talk to Apache Cassandra NoSQL db? I am
thinking no.
The ngx_lua module’s cosocket branch has implemented a nonblocking but
still synchronous TCP/unix domain socket API for Lua. I think the most
natural and efficient way is to code up a TCP client library in pure
Lua that understands Cassandra’s wired protocol if I’m not missing
anything obvious here 
Cassandra uses Apache Thrift as it’s driver / service layer. Using
Thrift you can write in C, but then you have a glib dependency, or I can
code in C++. What do you recommend? Adding the glib dependency or
writing an upstream implementation that talks to a C++ library that is
compatible with C?
Reusing existing Cassandra drivers could be much trickier compared to
cosocket-based pure Lua drivers as mentioned above, but Piotr S.
has done something quite generic in his ngx_zeromq module, maybe Piotr
can give some advice here.
Providing a hook for native 3rd-party drivers in ngx_lua’s cosocket
mechanism is also on my TODO list though 
P.S. I am planning on making this opensource …
Yay!
Best,
-agentzh
Thanks Agentzh,
I initially wanted to right a direct socket connection with Cassandra,
but their protocol is not well documented. Looks like I get to figure
out how Thrift works. It may also may make upgrades a bit tricky 
Bottom line is that I need high performance, and I am really concerned
that Thrift is going to get in the way.
Well let me take a look figuring out what the heck this Thrift client is
actually doing.
Thanks for the advice. I am sure it is not going to be the last time I
ask.
Now the true question is lua or c …
Chris
Posted at Nginx Forum:
Hi,
Piotr S.
has done something quite generic in his ngx_zeromq module, maybe Piotr
can give some advice here.
Thrift is doing only (de-)serialization, so the easiest way would be to
just
hook into nginx’s upstream module without using any trickery or
3rd-party
libraries (this requires writing your own (de-)serialization logic).
Take a look at FastCGI module, for example.
Best regards,
Piotr S. < [email protected] >
Hi,
I know this thread is already two and a half years old now, but if
someone
ends up here googling for a Cassandra module, I have implemented one in
Lua
using CQL binary protocol:
Cheers,
Juarez
Posted at Nginx Forum: