Module Advice - Cassandra / Thrift

agentzh agentzh at
Tue Jan 31 04:05:00 UTC 2012

On Tue, Jan 31, 2012 at 1:50 AM, chrislovecnm <nginx-forum at> 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 Sikora
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 ...



More information about the nginx mailing list