如何在CouchDB中计划索引更新 [英] How do you Schedule Index Updates in CouchDB

查看:836
本文介绍了如何在CouchDB中计划索引更新的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

据我所知,CouchDB索引在查询视图时更新。假设有更多的读而不是写,这不是缩放吗?

As far as I understand, CouchDB indexes are updated when a view is queried. Assuming there are more reads than writes, isn't this bad for scaling? How would I configure CouchDB to update indexes on writes, or better yet, on a schedule?

推荐答案

CouchDB在更新时重新生成视图,但只是从上次读取访问视图后发生了什么变化。假设您的读取音量大大超过您的写入量,这不应该是一个问题。

CouchDB does regenerate views on update, but only on what has changed since the last read access to the view. Assuming your read volume greatly outweighs your write volume, this shouldn't be a problem.

当您立即更改大量文档时,这可能导致的第一读请求花费显着的时间量。为了减轻这种情况,提出了几种不同的可能性。大多数依赖于使用CouchDB的更新通知进行注册,并自动触发读取。

When you're changing large numbers of documents at once this could lead to the possibility of the first read requests taking a noticeable amount of time. To alleviate this a few different possibilities have been suggested. Most rely on registering with CouchDB's update notifications and triggering reads automatically.

完全可以在CouchDB wiki上找到一个示例脚本[1]。

An example script for doing exactly that is available on the CouchDB wiki at [1].

[1] http://wiki.apache.org/couchdb / RegeneratingViewsOnUpdate

这篇关于如何在CouchDB中计划索引更新的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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