You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@couchdb.apache.org by Brian Candler <B....@pobox.com> on 2009/07/08 21:03:40 UTC
Up-to-date ruby view server?
Can somebody point me at the most up-to-date Ruby view server code?
The wiki points to
http://theexciter.com/articles/couchdb-views-in-ruby-instead-of-javascript.html
which in turn leads me to clone
git://gitorious.org/couchobject/mainline.git
However, bin/couch_ruby_view_requestor is not in the current branch.
$ git log -- bin
commit c343adcdd8f6dad6aca0f0b8419c023e2ff6da9e
Author: Johan Sørensen <jo...@johansorensen.com>
Date: Mon May 12 23:41:44 2008 +0200
Removed the Ruby view server and #filter method
It is to be distributed as a seperate library.
Obviously I can get the code as it was from the repo, but I was hoping there
would be a 'current' version somewhere. Googling for
couch_ruby_view_requestor doesn't turn up much, apart from older clones of
this repo.
The reason for this is that I've discovered I need to do some arithmetic on
large (128-bit) integers in my views. Javascript won't work without serious
messing around. Ruby would handle that quite nicely as Bignums, and in any
case the rest of my app is in Ruby too, so migrating to a Ruby view server
seems like the obvious thing to do.
Thanks,
Brian.
P.S. I'd be happy to give erlview a stab too, but at the moment it appears
to involve patching the core couchdb.
Re: Up-to-date ruby view server?
Posted by Brian Candler <B....@pobox.com>.
On Wed, Jul 08, 2009 at 06:40:48PM -0400, Paul Davis wrote:
> In trunk there's a file test/query_server_spec.rb that will test your
> view server for correctness. Might help in getting a compliant
> implementation.
That was very helpful, thank you - it helped me spot my (stupid) error.
Everything is working now.
I have updated test/query_server_spec.rb to add ruby code for map and
reduce, which you can pick up from my repo:
http://github.com/candlerb/couchdb_ruby_view
Performance is good - benchmarks suggest 10-20% faster than Javascript view
server even with COUCHDB-399 patch. But security is awful. Better make sure
users can't write design documents or access _temp_view :-)
Regards,
Brian.
Re: Up-to-date ruby view server?
Posted by Paul Davis <pa...@gmail.com>.
Brian,
In trunk there's a file test/query_server_spec.rb that will test your
view server for correctness. Might help in getting a compliant
implementation.
Paul
On Wed, Jul 8, 2009 at 6:35 PM, Brian Candler<B....@pobox.com> wrote:
> Well I couldn't wait :-) So I took the existing code, and found that it
> didn't support reduce/rereduce, so I added that.
>
> Code available at http://github.com/candlerb/couchdb_ruby_view
>
> Modifying my benchmark suite to use Ruby views, it seems to run
> substantially faster than Javascript - and this is with ruby 1.8.7 not 1.9.
>
> However I'm seeing an intermittent problem with wrong view data being
> returned (a view which should return 3000 rows is returning zero, or vice
> versa), so I'll investigate that further.
>
> Regards,
>
> Brian.
>
Re: Up-to-date ruby view server?
Posted by Brian Candler <B....@pobox.com>.
Well I couldn't wait :-) So I took the existing code, and found that it
didn't support reduce/rereduce, so I added that.
Code available at http://github.com/candlerb/couchdb_ruby_view
Modifying my benchmark suite to use Ruby views, it seems to run
substantially faster than Javascript - and this is with ruby 1.8.7 not 1.9.
However I'm seeing an intermittent problem with wrong view data being
returned (a view which should return 3000 rows is returning zero, or vice
versa), so I'll investigate that further.
Regards,
Brian.