You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Mark Vigeant <ma...@riskmetrics.com> on 2009/10/26 16:40:22 UTC

Programming to upload into couchdb

Hey-

I'd like to write a program to upload data into several documents in a database, but first I want to ask a few questions to see how I should go about it:


1.       I started toying around with jcouchdb, a java API that I found. Is there a "better" language to work with? Do you think writing in JavaScript might be more efficient? Or are there other libraries and APIs worth looking into that more people are using/updating?

2.       Has anyone else written any mass-upload programs? I was thinking about writing a map-reduce job on top of Hadoop because I've been playing around with hadoop for a while. Does anyone have any other suggestions? Or better yet, example code?

Thanks a lot for your time!

Mark Vigeant
RiskMetrics Group, Inc.


RE: Programming to upload into couchdb

Posted by Mark Vigeant <ma...@riskmetrics.com>.
Ok, thanks a lot for your input Jim! 

-----Original Message-----
From: Jim Kass [mailto:jim@nhrevolution.com] 
Sent: Monday, October 26, 2009 12:50 PM
To: user@couchdb.apache.org
Subject: Re: Programming to upload into couchdb

Mark,

Python and Ruby both have good libraries available but as Couch speaks  
HTTP it doesn't really require anything more than an HTTP client  
library such as cURL.

Couch is language independent, just like a web server itself.  You can  
create new docs in couch using nothing more than an HTML form and a  
web browser.

When reading, all you need is to do is convert the http response from  
JSON into the language of your choice.

A bulk uploader might read a long list of Files, convert then to an  
array of JSON objects then loop through them. Then for each one, issue  
a POST request with the JSON as a string in the body of the request.

So, you need a JSON library, IO for reading an input file and http  
client library (like cURL). Language is up to you.

Jim



Sent from my iPhone

On Oct 26, 2009, at 8:40 AM, Mark Vigeant  
<ma...@riskmetrics.com> wrote:

> Hey-
>
> I'd like to write a program to upload data into several documents in  
> a database, but first I want to ask a few questions to see how I  
> should go about it:
>
>
> 1.       I started toying around with jcouchdb, a java API that I  
> found. Is there a "better" language to work with? Do you think  
> writing in JavaScript might be more efficient? Or are there other  
> libraries and APIs worth looking into that more people are using/ 
> updating?
>
> 2.       Has anyone else written any mass-upload programs? I was  
> thinking about writing a map-reduce job on top of Hadoop because  
> I've been playing around with hadoop for a while. Does anyone have  
> any other suggestions? Or better yet, example code?
>
> Thanks a lot for your time!
>
> Mark Vigeant
> RiskMetrics Group, Inc.
>

Re: Programming to upload into couchdb

Posted by Jim Kass <ji...@nhrevolution.com>.
Mark,

Python and Ruby both have good libraries available but as Couch speaks  
HTTP it doesn't really require anything more than an HTTP client  
library such as cURL.

Couch is language independent, just like a web server itself.  You can  
create new docs in couch using nothing more than an HTML form and a  
web browser.

When reading, all you need is to do is convert the http response from  
JSON into the language of your choice.

A bulk uploader might read a long list of Files, convert then to an  
array of JSON objects then loop through them. Then for each one, issue  
a POST request with the JSON as a string in the body of the request.

So, you need a JSON library, IO for reading an input file and http  
client library (like cURL). Language is up to you.

Jim



Sent from my iPhone

On Oct 26, 2009, at 8:40 AM, Mark Vigeant  
<ma...@riskmetrics.com> wrote:

> Hey-
>
> I'd like to write a program to upload data into several documents in  
> a database, but first I want to ask a few questions to see how I  
> should go about it:
>
>
> 1.       I started toying around with jcouchdb, a java API that I  
> found. Is there a "better" language to work with? Do you think  
> writing in JavaScript might be more efficient? Or are there other  
> libraries and APIs worth looking into that more people are using/ 
> updating?
>
> 2.       Has anyone else written any mass-upload programs? I was  
> thinking about writing a map-reduce job on top of Hadoop because  
> I've been playing around with hadoop for a while. Does anyone have  
> any other suggestions? Or better yet, example code?
>
> Thanks a lot for your time!
>
> Mark Vigeant
> RiskMetrics Group, Inc.
>