5

After posting yesterday about a fairly slow couchdb design-doc/view yesterday here: CouchDB delay building index (CouchDB 1.5.0 on Windows Server 2008 R2) , I am trying to investigate if I could gain significant performance if I was to rewrite slow views in Erlang.

Being a total Erlang newbie, I find that the ground of specific erlang/couch tutorial is quite thin. The most up to date queries I can find here are already old and extremely brief: Erlang Views in Couch DB and Translate CouchDB javascript views to erlang . They refer to version 0.10.0.

I am really surprised there does not seem to be any more recent document or tutorial. If you are using Erlang views, what resources did you use to teach yourself? If I am missing any good resources on Erlang and views, please point these out to me.

Finally I am trying to figure out if there's anything else I need to install to run these such as erlang itself.

I am running couchdb 1.5 on Windows, but prototyping on Ubuntu, so would have to consider both systems.

1 Answer 1

5

This is the best discussion that I have found on couchdb native views. They are still a hidden feature of couchdb and there are not many people who use it.

To summarize the discussion in the link

Erlang views are significanly faster than javascript views. But there could be security implications since they run natively and are not sand boxed like javascript views.

There are not many tutorials because there is not much to learn about them. They are just like normal couchdb views translated into erlang. If you gave an example of your view maybe we could help you translate it into erlang but you will have to learn the basics of language if you want to write your own views in it.

I am trying to figure out if there's anything else I need to install to run these such as erlang itself

Nothing. Every thing you need is provided by the couchdb itself.

3
  • It'll be hard to provide an example of the view. It's a complete library with logic to access over 20 different file formats and over 1000 lines of code. We unit and regression test it carefully in an external environment, then place it in an 'empty' view of the design doc that uses it.
    – Hans
    Apr 11, 2014 at 8:29
  • You may have already seen it but there is a starter example of erlang view server in the couchdb manual itself that can help you get started. Apr 11, 2014 at 8:45
  • I think the best I can suggest is that you create a test erlang view locally and measure the performance. It will definitely be faster as compared to javascript views but once they are built I don't know how much performance benefit you can get. Instead of re building views have you tired the PPP technique that Jason mentioned in the link I supplied in my answer? Would that work for your case? Apr 11, 2014 at 8:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.