嵌入式CouchDB [英] Embedded couchDB

查看:72
本文介绍了嵌入式CouchDB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

CouchDB很棒,我喜欢它的 p2p复制功能,但是它更大一些(因为我们必须安装Erlang),并且在桌面应用程序中使用时要慢一些.

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.

正如我在intel duo core cpu中测试的那样,

As I tested in intel duo core cpu,

  1. 12秒以加载10000个文档
  2. 插入10000个文档需要10秒,但更新视图需要20秒,因此总共需要30秒

是否有没有SQL实现具有相同的 p2p复制功能,但是像sqlite一样小,速度也很好(加载10000个文档需要1秒).

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

推荐答案

您是否尝试过使用Hovercraft和/或Erlang视图服务器?我遇到了类似的问题,发现留在Erlang VM中(从而避免了对SpiderMonkey的游览)给了我所需的动力.我做了三件事...

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. 提升查询:将js的mapreduce函数移植到本地" Erlang通常在查询沙发(http://wiki.apache.org/couchdb/EnableErlangViews)时可显着提高性能.另外,管理视图更容易,因为您可以调用外部库或自己的编译模块(只需将它们添加到ebin目录中),从而减少了开发期间需要执行的上载次数.

  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.

提高插入效率:使用Hovercraft进行插入可将X100的性能提高最多(https://github.com/jchris/hovercraft.)CouchDB书(http://guide.couchdb.org)中提到了这一点./draft/performance.html)

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)

运行前视图:对桌面应用程序可以做的最后一件事是在应用程序启动期间运行视图(例如,显示初始屏幕时.)第一次运行视图总是最慢,后续运行速度更快.

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.

这些对我有很大帮助.

  • 爱德蒙-

这篇关于嵌入式CouchDB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆