Elasticsearch独奏vs Couchbase + Elasticsearch [英] Elasticsearch solo vs Couchbase+Elasticsearch

查看:62
本文介绍了Elasticsearch独奏vs Couchbase + Elasticsearch的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

让我描述一下这个问题.现在我处于架构变更阶段.我曾经将Elasticsearch用作聚合和搜索工具,但现在我正在考虑将其用作主数据库.我读到,不建议将Elasticsearch用作主要数据库,而仅用作索引.因此,我阅读了有关与Couchbase连接的演示文稿:

Let me describe the issue. Now I'm at the stage of architectural changes. I used to use Elasticsearch as aggregation and search tool, but now I'm thinking about use it as main DB. I read that there is not recommended to use Elasticsearch as a main DB, only as a index. So I read presentation about connection it with Couchbase:

我下载并安装了Couchbase和插件以与Elasticsearch集成

I downloaded and installed Couchbase and plugin for integration with Elasticsearch

https://github.com/couchbaselabs/elasticsearch-transport-couchbase

我不相信这种解决方案.首先,Elasticsearch中的聚合速度更快.其次,Elasticsearch支持直方图,地理位置,全文搜索和许多其他功能,因此,保留Couchbase的唯一原因似乎不是以Elasticsearch作为主要数据库.

I'm not convinced about this solution. Firstly, aggregation is faster in Elasticsearch. Secondly, Elasticsearch supports histogram, geopoints, full text search and many other, so it seems that only reason to keep Couchbase is not to have Elasticsearch as the main DB.

因此,我的问题是就我而言,将Elasticsearch与Couchbase集成的好处是什么?

So my question is about the benefits of integration Elasticsearch with Couchbase in my case?

推荐答案

到目前为止,我使用弹性搜索作为主要数据存储遇到的唯一重要问题是索引新文档时的索引延迟.Elasticsearch是一个近"实时搜索引擎...近"限定符是必需的,因为在您为文档建立索引之前最多有1秒的延迟,然后才能在搜索过程中找到该文件.

The only significant issue I've run into so far with using elasticsearch as a primary data store is the indexing delay when you index a new document. Elasticsearch is a "near" realtime search engine...the "near" qualifier is necessary because there is up to a 1-sec delay after you index a document before it will be found during a search.

以下是弹性搜索指南相关部分的链接:

Here's a link to the relevant portion of the elasticsearch guide:

elasticsearch中的近实时搜索

这是我构建的Web应用程序中的一个问题,该应用程序包含一个列出用户的页面.我的情况是管理员在用户列表页面上单击新用户"按钮,然后将他带到另一个页面来创建用户.当管理员保存用户文档时,他被重定向到列表页面,但是由于elasticsearch的索引延迟,新创建的用户没有出现.

This was an issue in a web application I built that contains a page that lists users. My scenario was the admin clicked a "new user" button on a user list page and he was then brought to another page to create the user. When the admin saved the user document, he was redirected to the list page, but the newly created user did not show up because of elasticsearch's indexing delay.

elasticsearch指南说您可以手动刷新索引,但是说不要在生产中这样做.

The elasticsearch guide says you can manually refresh the index, but says not to do it in production.

...每次在生产环境中为文档编制索引时,都不要进行手动刷新;这会损害您的表现.相反,您的应用程序需要了解Elasticsearch的近实时性并为此留出余地.

无论如何,我最终还是刷新了索引,因为在我的应用程序中很少会创建新用户,但这并不是一个很好的解决方案.

I ended up refreshing the index anyway because creating new users is a very rare occurrence in my app, but it's not a very good solution.

几个月前,我发布了一个问题,询问其他人如何解决此问题:

I posted a question a couple of months ago asking how other people get around this issue:

如何处理Elasticsearch索引延迟

这个问题的答案有我喜欢的建议.基本上,作者建议使用您提交的数据将记录手动插入列表中,而不要等待服务器返回.只要您不依赖服务器生成的字段,该方法就可以正常工作.

The answer to that question had a suggestion I liked. Basically the author suggests inserting the record into the list manually using the data you submit instead of waiting for the return from the server. That should work as long as you don't rely on server generated fields.

但是,最终,您不应在Couchbase之类的数据库中遇到此问题.

Ultimately though, you should not encounter this issue with a database like Couchbase.

这篇关于Elasticsearch独奏vs Couchbase + Elasticsearch的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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