You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Patrick Maia <pa...@gmail.com> on 2012/03/08 00:45:39 UTC

the best java client library

Hi, which of the libraries listed here (
http://wiki.apache.org/couchdb/Getting_started_with_Java) is the most
widely accepted/used by java developers? Are there other options? What do
you use?

Thanks,

Patrick

Re: the best java client library

Posted by Kristian Rink <ka...@googlemail.com>.
Am 08.03.2012 00:45, schrieb Patrick Maia:
> Hi, which of the libraries listed here (
> http://wiki.apache.org/couchdb/Getting_started_with_Java) is the most
> widely accepted/used by java developers? Are there other options? What do
> you use?

Depends upon the use case: In more "structured" situations in which we 
try having more or less accurate mappings of Java objects to JSON 
documents, we have recently discovered and adopted ektorp and found this 
to be rather mature and painless to get the job done. In less 
"structured" situations or in applications in which the amount of third 
party dependencies should be reduced to a minimum, we usually make use 
of some sort of HTTP client (apache commons, or the Jersey/JAX-RS client 
libs) and the svenson JSON lib to get the job done which also works 
pretty well. Overally, comparing to communicating with other 
infrastructure (including SQL DB backends), we have explicitely found 
the option to communicate with CouchDB without being forced to use 
certain client libraries to be one of the outstanding features of this 
approach. :)

Cheers,
Kristian

Re: the best java client library

Posted by Martin Hewitt <ma...@thenoi.se>.
We use our own library (Jetty (asynchronous) HTTP client & Gson or Jackson), but we do use the ViewQuery class in ektorp, which does a really nice job of encapsulating and encoding the various querystring parameters that can be used when getting views.

Martin

On 8 Mar 2012, at 13:44, Patrick Maia wrote:

> Thank you. I'll take a look in ektorp, but I think I'll end up writing my
> own lib as most of you did.
> 
> Patrick Maia
> +55 83 8740-8192
> 
> 
> On Thu, Mar 8, 2012 at 4:19 AM, Aurélien Bénel <au...@utt.fr>wrote:
> 
>> Hi,
>> 
>>> The majority of the time a good HTTP client library and JSON library are
>> enough.
>> 
>> Indeed. Once you have good libraries for JSON and HTTP, it's rather easy
>> to write your own CouchDB library.
>> 
>> For instance, here is mine, following the "data access object" design
>> pattern, with a focus on read performance (cached bulk GET), easy
>> navigation in views and notifications on _changes:
>> 
>> 
>> https://github.com/Hypertopic/Porphyry/blob/master/src/org/hypertopic/RESTDatabase.java
>> 
>> https://github.com/Hypertopic/Porphyry/blob/master/src/org/hypertopic/RESTDatabaseTest.java
>> 
>> 
>> Regards,
>> 
>> Aurélien


Re: the best java client library

Posted by Patrick Maia <pa...@gmail.com>.
Thank you. I'll take a look in ektorp, but I think I'll end up writing my
own lib as most of you did.

Patrick Maia
+55 83 8740-8192


On Thu, Mar 8, 2012 at 4:19 AM, Aurélien Bénel <au...@utt.fr>wrote:

> Hi,
>
> > The majority of the time a good HTTP client library and JSON library are
> enough.
>
> Indeed. Once you have good libraries for JSON and HTTP, it's rather easy
> to write your own CouchDB library.
>
> For instance, here is mine, following the "data access object" design
> pattern, with a focus on read performance (cached bulk GET), easy
> navigation in views and notifications on _changes:
>
>
> https://github.com/Hypertopic/Porphyry/blob/master/src/org/hypertopic/RESTDatabase.java
>
> https://github.com/Hypertopic/Porphyry/blob/master/src/org/hypertopic/RESTDatabaseTest.java
>
>
> Regards,
>
> Aurélien

Re: the best java client library

Posted by Aurélien Bénel <au...@utt.fr>.
Hi,

> The majority of the time a good HTTP client library and JSON library are enough.

Indeed. Once you have good libraries for JSON and HTTP, it's rather easy to write your own CouchDB library.

For instance, here is mine, following the "data access object" design pattern, with a focus on read performance (cached bulk GET), easy navigation in views and notifications on _changes:

   https://github.com/Hypertopic/Porphyry/blob/master/src/org/hypertopic/RESTDatabase.java
   https://github.com/Hypertopic/Porphyry/blob/master/src/org/hypertopic/RESTDatabaseTest.java


Regards,

Aurélien

Re: the best java client library

Posted by Dan Everton <da...@iocaine.org>.
Never found the need for a library to wrap the CouchDB API. The majority of
the time a good HTTP client library and JSON library are enough. We've had
good luck with Async HTTP Client (
https://github.com/sonatype/async-http-client) and Jackson (
http://jackson.codehaus.org/).

Re: the best java client library

Posted by Hristo Deshev <hr...@deshev.com>.
On 03/08/2012 05:29 AM, 7zark7 wrote:
> Ektorp is nice, though have personally I've found Apache HTTP Client + Jackson to be very simple as well.

I'm using Ektorp on the JVM (Scala) and I'm pretty happy with it. Add 
ektorplucene [1] for your couchdb-lucene queries and you're done.

Hristo

[1] https://github.com/ldriscoll/ektorplucene

Re: the best java client library

Posted by 7zark7 <7z...@gmail.com>.
Ektorp is nice, though have personally I've found Apache HTTP Client + Jackson to be very simple as well.


Sent with Sparrow (http://www.sparrowmailapp.com/?sig)


On Wednesday, March 7, 2012 at 3:45 PM, Patrick Maia wrote:

> Hi, which of the libraries listed here (
> http://wiki.apache.org/couchdb/Getting_started_with_Java) is the most
> widely accepted/used by java developers? Are there other options? What do
> you use?
> 
> Thanks,
> 
> Patrick