Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CouchDB Erlang View

Tags:

erlang

couchdb

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.

like image 534
Hans Avatar asked Apr 10 '14 14:04

Hans


1 Answers

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.

like image 143
Akshat Jiwan Sharma Avatar answered Sep 30 '22 11:09

Akshat Jiwan Sharma