You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Aditya Agustyana <ad...@gmail.com> on 2010/08/22 07:33:24 UTC

connect Ruby on Rails app to Couchdb, using library or just plain http connection ?

Hi All

it's the first time i post an email in here :), so let me introduce
myself, i'm Aditya, a Ruby on Rails (RoR) developer and a long time
SQL user
days ago, i decided to learn something new, and i found "NoSql" as new
kids on the block in database area, it seems fun to learn any other
paradigm beside SQL
so i picked apache couchdb and install it in my Mac, now i'm ready to
develop my personal project using RoR & CouchDB
in Ruby world, there are bunch of CouchDb library that can be used to
connect to RoR, i found couchrest & couch potato seems pretty
interesting

i read the couchdb tutorial a bit, and it's suprise me, because the
data can be accessed from HTTP directly
this fact actually made me think, if there a way to access couchdb
data directly, why do we need some kind of library as "middleware"  ?
i mean in OLD days sql, it's imposible to connect  from Programming
Language to Database directly, so that's why they create
driver/library for it

so i need any advise from you guys, which path i need to choose, using
plain http connection or using a library ?, to connect Rails App to
Couch Db

any advise is much appreciated

*apologize for my bad english, it isn't my main language*


regards


Aditya


-- 
blog : http://adityakircon.blogsome.com
ym / twitter : kirconboy
skype : adit_skype

Be Nice. Treat others with the same respect you'd want them to treat
you. We're all here to learn together.  Be tolerant of others who may
not know everything you know. BRING YOUR SENSE OF HUMOR
(stackoverflow.com)

Re: connect Ruby on Rails app to Couchdb, using library or just plain http connection ?

Posted by Kenny Stone <ks...@connamara.com>.
It could be helpful when you are first learning Couch to approach it this
way.  CouchDB really is very easy to use because its API is RESTful and
pretty intuitive.

JSON.parse isn't very much code getting in your way.  You could use
'rest_client'
as a middle ground.

--
Kenny Stone
Connamara Systems, LLC


On Sun, Aug 22, 2010 at 6:48 AM, Jonathan Weiss <jw...@innerewut.de> wrote:

> > so i need any advise from you guys, which path i need to choose, using
> > plain http connection or using a library ?, to connect Rails App to
> > Couch Db
>
> I would go for a library as you don't want to have to use Net::HTTP
> and JSON parsing everywhere. Usually you want a library to abstract
> this away.
> There are several libraries out there for Ruby. Some are very
> low-level like couchrest, some are very high-level like SimplyStored.
>
> Jonathan
>
> --
> Jonathan Weiss
> http://blog.innerewut.de
> http://twitter.com/jweiss
>

Re: connect Ruby on Rails app to Couchdb, using library or just plain http connection ?

Posted by Jonathan Weiss <jw...@innerewut.de>.
> so i need any advise from you guys, which path i need to choose, using
> plain http connection or using a library ?, to connect Rails App to
> Couch Db

I would go for a library as you don't want to have to use Net::HTTP
and JSON parsing everywhere. Usually you want a library to abstract
this away.
There are several libraries out there for Ruby. Some are very
low-level like couchrest, some are very high-level like SimplyStored.

Jonathan

-- 
Jonathan Weiss
http://blog.innerewut.de
http://twitter.com/jweiss

Re: connect Ruby on Rails app to Couchdb, using library or just plain http connection ?

Posted by Julian Doherty <ju...@gmail.com>.
I've used the couchrest gem, and the couchrest-rails plugin before with a
lot of success. There are other's out there that do more apparently, but
couchrest stays pretty close to the metal while still being easy to work
with.

On 22 August 2010 15:33, Aditya Agustyana <ad...@gmail.com> wrote:

> Hi All
>
> it's the first time i post an email in here :), so let me introduce
> myself, i'm Aditya, a Ruby on Rails (RoR) developer and a long time
> SQL user
> days ago, i decided to learn something new, and i found "NoSql" as new
> kids on the block in database area, it seems fun to learn any other
> paradigm beside SQL
> so i picked apache couchdb and install it in my Mac, now i'm ready to
> develop my personal project using RoR & CouchDB
> in Ruby world, there are bunch of CouchDb library that can be used to
> connect to RoR, i found couchrest & couch potato seems pretty
> interesting
>
> i read the couchdb tutorial a bit, and it's suprise me, because the
> data can be accessed from HTTP directly
> this fact actually made me think, if there a way to access couchdb
> data directly, why do we need some kind of library as "middleware"  ?
> i mean in OLD days sql, it's imposible to connect  from Programming
> Language to Database directly, so that's why they create
> driver/library for it
>
> so i need any advise from you guys, which path i need to choose, using
> plain http connection or using a library ?, to connect Rails App to
> Couch Db
>
> any advise is much appreciated
>
> *apologize for my bad english, it isn't my main language*
>
>
> regards
>
>
> Aditya
>
>
> --
> blog : http://adityakircon.blogsome.com
> ym / twitter : kirconboy
> skype : adit_skype
>
> Be Nice. Treat others with the same respect you'd want them to treat
> you. We're all here to learn together.  Be tolerant of others who may
> not know everything you know. BRING YOUR SENSE OF HUMOR
> (stackoverflow.com)
>