10

CouchDB is great, I like its p2p replication functionality, but it's a bit larger(because we have to install Erlang) and slower when used in desktop application.

As I tested in intel duo core cpu,

  1. 12 seconds to load 10000 docs
  2. 10 seconds to insert 10000 doc, but need 20 seconds to update view, so total is 30 seconds

Is there any No SQL implementation which has the same p2p replication functionality, but the size is very small like sqlite, and the speed is quite good(1 second to load 10000 docs).

2 Answers 2

4

Have you tried using the Hovercraft and/or the Erlang view server? I had a similar problem and found staying within the Erlang VM (thereby and avoiding excursions to SpiderMonkey) gave me the boost I needed. I did 3 things...

  1. Boosting Queries: Porting your mapreduce functions from js to "native" Erlang usually gives tremendous performance boost when querying couch (http://wiki.apache.org/couchdb/EnableErlangViews). Also, managing views is easier coz you can call external libs or your own compiled modules (just add them to your ebin dir) reducing the number of uploads you need to do during development.

  2. Boosting Inserts: Using Hovercraft for inserts gives upto X100 increase in performance (https://github.com/jchris/hovercraft.) This was mentioned in the CouchDB book (http://guide.couchdb.org/draft/performance.html)

  3. Pre-Run Views: The last thing you can do for desktop apps is run your views during application startup (say, when the splash-screen is showing.) The first time views are run is always the slowest, subsequent runs are faster.

These helped me a lot.

  • Edmond -
4
  • hi edmond How does call hovercraft in c#?
    – Chang
    Dec 28, 2010 at 17:21
  • You could write an API but I don't think you would benefit much. The aim of the above listed techniques is to use Erlang as much as possible (CouchDB is written in Erlang.) Specifically, staying within the Erlang VM. The performance boost comes from avoiding socket communcation and better aligning Dec 30, 2010 at 10:21
  • Scrap that: got cut off... You could write an API but I don't think you would benefit much. The aim of the above listed techniques is to use Erlang as much as possible (CouchDB is written in Erlang.) Specifically, staying within the Erlang VM. The performance boost comes from: 1) Avoiding pipe communication with the JavaScript engine; 2) Avoiding socket communication; 3) Better aligning your mapreduce functions with Erlang's natural concurrency strengths. These goals can be achieved using the Erlang View Server (for queries) and Hovercraft (for inserts). Dec 30, 2010 at 10:50
  • Bottom line: from my experience, if you want CouchDB to run faster, you need to move towards Erlang and away from JS and other languages. Go along the grain rather than against it. Dec 30, 2010 at 10:52
2

Unfortunately the question doesn't offer enough details about your app requirements so it's kind of difficult to offer an advise. Anyways, I'm not aware of any other storage solution offering a similar/advanced P2P replication.

A couple of questions/comments about your your requirements:

  1. what kind of desktop app requires 10000 inserts/second?
  2. when you say size what exactly are you referring to?

You might want to take a look at:

  • Redis
  • RavenDB

Also check some of the other NoSQL-solutions listed on http://nosql.mypopescu.com against your app requirements.

1
  • Hi alexpopescu I updated the question! we need load all of docs in very few seconds, so that we can group,sort and search them quickly. sqlite can provide such performance, assume the transfered size is same.
    – Chang
    Dec 24, 2010 at 4:44

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.