Embedded couchDB

半世苍凉 提交于 2021-01-27 03:50:45

问题


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


回答1:


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.




回答2:


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 -


来源:https://stackoverflow.com/questions/4516226/embedded-couchdb

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!