Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Embedded couchDB

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).

like image 664
Chang Avatar asked Dec 23 '10 05:12

Chang


2 Answers

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 -
like image 61
Edmond Begumisa Avatar answered Oct 05 '22 20:10

Edmond Begumisa


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.

like image 38
alexpopescu Avatar answered Oct 05 '22 19:10

alexpopescu