You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cassandra.apache.org by indika kumara <in...@apache.org> on 2011/01/16 17:50:08 UTC

Exposing Cassandra as a Web Service

Hi All,

What would you think about the idea of exposing the Cassandra as a Web
Service so that any web service client can connect to the Cassandra server?

This would require embedding a web service engine in the server side,
providing WSDL(s) for Cassandra’s services such as management, data access,
etc.

If this task can be done, it is possible to connect to the Cassandra through
different languages, different transports such as TCP, HTTP, JMS, etc.
Moreover, the connection between clients and the Cassandra can be secure
(WS-Security), and reliable.

If this task is worth, I may be able to contribute for implementing it. I am
familiar with the Axis2 web service engine [1], and an Apache committer.

Your suggestions are welcome!

Thanks,

Indika

[1] http://axis.apache.org/axis2/java/core/

Re: Exposing Cassandra as a Web Service

Posted by indika kumara <in...@gmail.com>.
Thank you for the information about the TServlet . I would only develop what
I suggested if the Cassandra community find that it is worth. BTW, it is
possible to write a non blocking HTTP/S transport that offers a significant
performance. Even the JMS may be worth.

Thanks,

Indika

On Mon, Jan 17, 2011 at 12:26 PM, Gaurav Sharma
<ga...@gmail.com>wrote:

> If you have good stories for such an abstraction, then, it can live atop
> thrift and extend Tom White's TServlet which is now a part of thrift:
>
> http://svn.apache.org/viewvc/thrift/branches/0.6.x/lib/java/src/org/apache/thrift/server/TServlet.java
> http://www.lexemetech.com/2007/09/java-servlet-for-thrift.html (brief
> explanation)
>
> Maybe others feel differently but imo, an http ws-client does not have to
> be
> bundled with Cassandra (data-store). Also, Thrift is really fast by itself.
> Please see if you want to plug into TServlet; let me know if you want to
> pair up and quickly crank out a simple ws client.
>
> -gshx
>
> On Sun, Jan 16, 2011 at 11:18 PM, indika kumara <indika.kuma@gmail.com
> >wrote:
>
> > Gaurav - I thought of enabling a WS-client to call Cassandra server nodes
> > directly.  For that, there should be a web-service engine to process the
> > WS-requests in the server-side. A client can be any WS-client that can
> call
> > a service using the service's WSDL. A client can use different protocol
> > such
> > as TCP, HTTP/S, JMS, etc. Accessing the resources in the Cassandra in a
> > RESTFUL manner may also be possible.
> >
> > Thanks,
> >
> > Indika
> >
> > On Mon, Jan 17, 2011 at 4:04 AM, Gaurav Sharma
> > <ga...@gmail.com>wrote:
> >
> > > Indika - what use cases do you have in mind for the ws-clients
> connecting
> > > directly to Cassandra especially since you mention connections from
> > clients
> > > using ws-security? Are you suggesting remote connections over https
> > > directly
> > > to the data-store between non-colocated client and server nodes? The
> > client
> > > in such a scenario will also likely have the server-side business
> logic.
> > > right - is that what you have in mind?
> > >
> > > Currently, there's already an excellent java client library Hector (
> > > https://github.com/rantav/hector) and a Thrift API (allows
> > cross-language
> > > rpc kind of like a web-service mediator/engine). So, there are good
> > > client-integration options with 'almost' minimal external lib
> > dependencies.
> > > Especially with java, imho, additional binary dependencies that result
> in
> > > the jar-hell phenomenon is quite irksome for most users. Axis has a few
> > lib
> > > dependencies of its own, too.
> > >
> > > -gshx
> > >
> > > On Sun, Jan 16, 2011 at 11:50 AM, indika kumara <in...@apache.org>
> > wrote:
> > >
> > > > Hi All,
> > > >
> > > > What would you think about the idea of exposing the Cassandra as a
> Web
> > > > Service so that any web service client can connect to the Cassandra
> > > server?
> > > >
> > > > This would require embedding a web service engine in the server side,
> > > > providing WSDL(s) for Cassandra’s services such as management, data
> > > access,
> > > > etc.
> > > >
> > > > If this task can be done, it is possible to connect to the Cassandra
> > > > through
> > > > different languages, different transports such as TCP, HTTP, JMS,
> etc.
> > > > Moreover, the connection between clients and the Cassandra can be
> > secure
> > > > (WS-Security), and reliable.
> > > >
> > > > If this task is worth, I may be able to contribute for implementing
> it.
> > I
> > > > am
> > > > familiar with the Axis2 web service engine [1], and an Apache
> > committer.
> > > >
> > > > Your suggestions are welcome!
> > > >
> > > > Thanks,
> > > >
> > > > Indika
> > > >
> > > > [1] http://axis.apache.org/axis2/java/core/
> > > >
> > >
> >
>

Re: Exposing Cassandra as a Web Service

Posted by Gaurav Sharma <ga...@gmail.com>.
If you have good stories for such an abstraction, then, it can live atop
thrift and extend Tom White's TServlet which is now a part of thrift:
http://svn.apache.org/viewvc/thrift/branches/0.6.x/lib/java/src/org/apache/thrift/server/TServlet.java
http://www.lexemetech.com/2007/09/java-servlet-for-thrift.html (brief
explanation)

Maybe others feel differently but imo, an http ws-client does not have to be
bundled with Cassandra (data-store). Also, Thrift is really fast by itself.
Please see if you want to plug into TServlet; let me know if you want to
pair up and quickly crank out a simple ws client.

-gshx

On Sun, Jan 16, 2011 at 11:18 PM, indika kumara <in...@gmail.com>wrote:

> Gaurav - I thought of enabling a WS-client to call Cassandra server nodes
> directly.  For that, there should be a web-service engine to process the
> WS-requests in the server-side. A client can be any WS-client that can call
> a service using the service's WSDL. A client can use different protocol
> such
> as TCP, HTTP/S, JMS, etc. Accessing the resources in the Cassandra in a
> RESTFUL manner may also be possible.
>
> Thanks,
>
> Indika
>
> On Mon, Jan 17, 2011 at 4:04 AM, Gaurav Sharma
> <ga...@gmail.com>wrote:
>
> > Indika - what use cases do you have in mind for the ws-clients connecting
> > directly to Cassandra especially since you mention connections from
> clients
> > using ws-security? Are you suggesting remote connections over https
> > directly
> > to the data-store between non-colocated client and server nodes? The
> client
> > in such a scenario will also likely have the server-side business logic.
> > right - is that what you have in mind?
> >
> > Currently, there's already an excellent java client library Hector (
> > https://github.com/rantav/hector) and a Thrift API (allows
> cross-language
> > rpc kind of like a web-service mediator/engine). So, there are good
> > client-integration options with 'almost' minimal external lib
> dependencies.
> > Especially with java, imho, additional binary dependencies that result in
> > the jar-hell phenomenon is quite irksome for most users. Axis has a few
> lib
> > dependencies of its own, too.
> >
> > -gshx
> >
> > On Sun, Jan 16, 2011 at 11:50 AM, indika kumara <in...@apache.org>
> wrote:
> >
> > > Hi All,
> > >
> > > What would you think about the idea of exposing the Cassandra as a Web
> > > Service so that any web service client can connect to the Cassandra
> > server?
> > >
> > > This would require embedding a web service engine in the server side,
> > > providing WSDL(s) for Cassandra’s services such as management, data
> > access,
> > > etc.
> > >
> > > If this task can be done, it is possible to connect to the Cassandra
> > > through
> > > different languages, different transports such as TCP, HTTP, JMS, etc.
> > > Moreover, the connection between clients and the Cassandra can be
> secure
> > > (WS-Security), and reliable.
> > >
> > > If this task is worth, I may be able to contribute for implementing it.
> I
> > > am
> > > familiar with the Axis2 web service engine [1], and an Apache
> committer.
> > >
> > > Your suggestions are welcome!
> > >
> > > Thanks,
> > >
> > > Indika
> > >
> > > [1] http://axis.apache.org/axis2/java/core/
> > >
> >
>

Re: Exposing Cassandra as a Web Service

Posted by indika kumara <in...@gmail.com>.
Gaurav - I thought of enabling a WS-client to call Cassandra server nodes
directly.  For that, there should be a web-service engine to process the
WS-requests in the server-side. A client can be any WS-client that can call
a service using the service's WSDL. A client can use different protocol such
as TCP, HTTP/S, JMS, etc. Accessing the resources in the Cassandra in a
RESTFUL manner may also be possible.

Thanks,

Indika

On Mon, Jan 17, 2011 at 4:04 AM, Gaurav Sharma
<ga...@gmail.com>wrote:

> Indika - what use cases do you have in mind for the ws-clients connecting
> directly to Cassandra especially since you mention connections from clients
> using ws-security? Are you suggesting remote connections over https
> directly
> to the data-store between non-colocated client and server nodes? The client
> in such a scenario will also likely have the server-side business logic.
> right - is that what you have in mind?
>
> Currently, there's already an excellent java client library Hector (
> https://github.com/rantav/hector) and a Thrift API (allows cross-language
> rpc kind of like a web-service mediator/engine). So, there are good
> client-integration options with 'almost' minimal external lib dependencies.
> Especially with java, imho, additional binary dependencies that result in
> the jar-hell phenomenon is quite irksome for most users. Axis has a few lib
> dependencies of its own, too.
>
> -gshx
>
> On Sun, Jan 16, 2011 at 11:50 AM, indika kumara <in...@apache.org> wrote:
>
> > Hi All,
> >
> > What would you think about the idea of exposing the Cassandra as a Web
> > Service so that any web service client can connect to the Cassandra
> server?
> >
> > This would require embedding a web service engine in the server side,
> > providing WSDL(s) for Cassandra’s services such as management, data
> access,
> > etc.
> >
> > If this task can be done, it is possible to connect to the Cassandra
> > through
> > different languages, different transports such as TCP, HTTP, JMS, etc.
> > Moreover, the connection between clients and the Cassandra can be secure
> > (WS-Security), and reliable.
> >
> > If this task is worth, I may be able to contribute for implementing it. I
> > am
> > familiar with the Axis2 web service engine [1], and an Apache committer.
> >
> > Your suggestions are welcome!
> >
> > Thanks,
> >
> > Indika
> >
> > [1] http://axis.apache.org/axis2/java/core/
> >
>

Re: Exposing Cassandra as a Web Service

Posted by Gaurav Sharma <ga...@gmail.com>.
Indika - what use cases do you have in mind for the ws-clients connecting
directly to Cassandra especially since you mention connections from clients
using ws-security? Are you suggesting remote connections over https directly
to the data-store between non-colocated client and server nodes? The client
in such a scenario will also likely have the server-side business logic.
right - is that what you have in mind?

Currently, there's already an excellent java client library Hector (
https://github.com/rantav/hector) and a Thrift API (allows cross-language
rpc kind of like a web-service mediator/engine). So, there are good
client-integration options with 'almost' minimal external lib dependencies.
Especially with java, imho, additional binary dependencies that result in
the jar-hell phenomenon is quite irksome for most users. Axis has a few lib
dependencies of its own, too.

-gshx

On Sun, Jan 16, 2011 at 11:50 AM, indika kumara <in...@apache.org> wrote:

> Hi All,
>
> What would you think about the idea of exposing the Cassandra as a Web
> Service so that any web service client can connect to the Cassandra server?
>
> This would require embedding a web service engine in the server side,
> providing WSDL(s) for Cassandra’s services such as management, data access,
> etc.
>
> If this task can be done, it is possible to connect to the Cassandra
> through
> different languages, different transports such as TCP, HTTP, JMS, etc.
> Moreover, the connection between clients and the Cassandra can be secure
> (WS-Security), and reliable.
>
> If this task is worth, I may be able to contribute for implementing it. I
> am
> familiar with the Axis2 web service engine [1], and an Apache committer.
>
> Your suggestions are welcome!
>
> Thanks,
>
> Indika
>
> [1] http://axis.apache.org/axis2/java/core/
>

Re: Exposing Cassandra as a Web Service

Posted by indika kumara <in...@gmail.com>.
Thanks Gary....  A HTTP transport based on NIO [1] may offer a considerable
performance. I may implement it locally and compare the performance.

Indika

[1] http://hc.apache.org/httpcomponents-core-ga/httpcore-nio/index.html

On Mon, Jan 17, 2011 at 8:01 PM, Gary Dusbabek <gd...@gmail.com> wrote:

> No, it's not in trunk.  I created the branch as a proof-of-concept
> only.  I can see the utility of a RESTful interface, but I doubt
> you'll be able to achieve performance comparable to thrift.
>
> Gary
>
> On Mon, Jan 17, 2011 at 07:23, indika kumara <in...@gmail.com>
> wrote:
> > Hi Gary,
> >
> > Thank you very much for the information. BTW, It seems that your
> transport
> > code is not in the Cassandra's trunk. Is it going add that code into the
> > trunk?  BTW, do you think what I suggested would be worth? If so, I would
> > like to implement it.
> >
> > Thanks,
> >
> > Indika
> >
> > On Mon, Jan 17, 2011 at 7:05 PM, Gary Dusbabek <gd...@gmail.com>
> wrote:
> >>
> >> It wouldn't be hard to do.  Cassandra is structured in such a way that
> >> it is pretty easy to wrap a transport around a few classes that handle
> >> most of the client interaction.  Last September I created a
> >> RESTful-like version of Cassandra in just a few hours.  I haven't
> >> maintained the branch, but you can find the results of the work here:
> >> https://github.com/gdusbabek/cassandra
> >>
> >> Gary
> >>
> >> On Sun, Jan 16, 2011 at 10:50, indika kumara <in...@apache.org> wrote:
> >> > Hi All,
> >> >
> >> > What would you think about the idea of exposing the Cassandra as a Web
> >> > Service so that any web service client can connect to the Cassandra
> >> > server?
> >> >
> >> > This would require embedding a web service engine in the server side,
> >> > providing WSDL(s) for Cassandra’s services such as management, data
> >> > access,
> >> > etc.
> >> >
> >> > If this task can be done, it is possible to connect to the Cassandra
> >> > through
> >> > different languages, different transports such as TCP, HTTP, JMS, etc.
> >> > Moreover, the connection between clients and the Cassandra can be
> secure
> >> > (WS-Security), and reliable.
> >> >
> >> > If this task is worth, I may be able to contribute for implementing
> it.
> >> > I am
> >> > familiar with the Axis2 web service engine [1], and an Apache
> committer.
> >> >
> >> > Your suggestions are welcome!
> >> >
> >> > Thanks,
> >> >
> >> > Indika
> >> >
> >> > [1] http://axis.apache.org/axis2/java/core/
> >> >
> >
> >
>

Re: Exposing Cassandra as a Web Service

Posted by Gary Dusbabek <gd...@gmail.com>.
No, it's not in trunk.  I created the branch as a proof-of-concept
only.  I can see the utility of a RESTful interface, but I doubt
you'll be able to achieve performance comparable to thrift.

Gary

On Mon, Jan 17, 2011 at 07:23, indika kumara <in...@gmail.com> wrote:
> Hi Gary,
>
> Thank you very much for the information. BTW, It seems that your transport
> code is not in the Cassandra's trunk. Is it going add that code into the
> trunk?  BTW, do you think what I suggested would be worth? If so, I would
> like to implement it.
>
> Thanks,
>
> Indika
>
> On Mon, Jan 17, 2011 at 7:05 PM, Gary Dusbabek <gd...@gmail.com> wrote:
>>
>> It wouldn't be hard to do.  Cassandra is structured in such a way that
>> it is pretty easy to wrap a transport around a few classes that handle
>> most of the client interaction.  Last September I created a
>> RESTful-like version of Cassandra in just a few hours.  I haven't
>> maintained the branch, but you can find the results of the work here:
>> https://github.com/gdusbabek/cassandra
>>
>> Gary
>>
>> On Sun, Jan 16, 2011 at 10:50, indika kumara <in...@apache.org> wrote:
>> > Hi All,
>> >
>> > What would you think about the idea of exposing the Cassandra as a Web
>> > Service so that any web service client can connect to the Cassandra
>> > server?
>> >
>> > This would require embedding a web service engine in the server side,
>> > providing WSDL(s) for Cassandra’s services such as management, data
>> > access,
>> > etc.
>> >
>> > If this task can be done, it is possible to connect to the Cassandra
>> > through
>> > different languages, different transports such as TCP, HTTP, JMS, etc.
>> > Moreover, the connection between clients and the Cassandra can be secure
>> > (WS-Security), and reliable.
>> >
>> > If this task is worth, I may be able to contribute for implementing it.
>> > I am
>> > familiar with the Axis2 web service engine [1], and an Apache committer.
>> >
>> > Your suggestions are welcome!
>> >
>> > Thanks,
>> >
>> > Indika
>> >
>> > [1] http://axis.apache.org/axis2/java/core/
>> >
>
>

Re: Exposing Cassandra as a Web Service

Posted by indika kumara <in...@gmail.com>.
Hi Gary,

Thank you very much for the information. BTW, It seems that your transport
code is not in the Cassandra's trunk. Is it going add that code into the
trunk?  BTW, do you think what I suggested would be worth? If so, I would
like to implement it.

Thanks,

Indika

On Mon, Jan 17, 2011 at 7:05 PM, Gary Dusbabek <gd...@gmail.com> wrote:

> It wouldn't be hard to do.  Cassandra is structured in such a way that
> it is pretty easy to wrap a transport around a few classes that handle
> most of the client interaction.  Last September I created a
> RESTful-like version of Cassandra in just a few hours.  I haven't
> maintained the branch, but you can find the results of the work here:
> https://github.com/gdusbabek/cassandra
>
> Gary
>
> On Sun, Jan 16, 2011 at 10:50, indika kumara <in...@apache.org> wrote:
> > Hi All,
> >
> > What would you think about the idea of exposing the Cassandra as a Web
> > Service so that any web service client can connect to the Cassandra
> server?
> >
> > This would require embedding a web service engine in the server side,
> > providing WSDL(s) for Cassandra’s services such as management, data
> access,
> > etc.
> >
> > If this task can be done, it is possible to connect to the Cassandra
> through
> > different languages, different transports such as TCP, HTTP, JMS, etc.
> > Moreover, the connection between clients and the Cassandra can be secure
> > (WS-Security), and reliable.
> >
> > If this task is worth, I may be able to contribute for implementing it. I
> am
> > familiar with the Axis2 web service engine [1], and an Apache committer.
> >
> > Your suggestions are welcome!
> >
> > Thanks,
> >
> > Indika
> >
> > [1] http://axis.apache.org/axis2/java/core/
> >
>

Re: Exposing Cassandra as a Web Service

Posted by Gary Dusbabek <gd...@gmail.com>.
It wouldn't be hard to do.  Cassandra is structured in such a way that
it is pretty easy to wrap a transport around a few classes that handle
most of the client interaction.  Last September I created a
RESTful-like version of Cassandra in just a few hours.  I haven't
maintained the branch, but you can find the results of the work here:
https://github.com/gdusbabek/cassandra

Gary

On Sun, Jan 16, 2011 at 10:50, indika kumara <in...@apache.org> wrote:
> Hi All,
>
> What would you think about the idea of exposing the Cassandra as a Web
> Service so that any web service client can connect to the Cassandra server?
>
> This would require embedding a web service engine in the server side,
> providing WSDL(s) for Cassandra’s services such as management, data access,
> etc.
>
> If this task can be done, it is possible to connect to the Cassandra through
> different languages, different transports such as TCP, HTTP, JMS, etc.
> Moreover, the connection between clients and the Cassandra can be secure
> (WS-Security), and reliable.
>
> If this task is worth, I may be able to contribute for implementing it. I am
> familiar with the Axis2 web service engine [1], and an Apache committer.
>
> Your suggestions are welcome!
>
> Thanks,
>
> Indika
>
> [1] http://axis.apache.org/axis2/java/core/
>