Elasticsearch vs Cassandra vs Elasticsearch with Cassandra [英] Elasticsearch vs Cassandra vs Elasticsearch with Cassandra

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

问题描述

我正在学习 NoSQL 并正在寻找满足我客户要求的不同选项.在提出这个问题之前,我已经浏览了各种资源(一个对 NoSQL 知之甚少的人)

I am learning NoSQL and looking at different options for one of my client's requirements. I have gone through various resources before putting up this question (a person with little knowledge in NoSQL)

  • 我需要以更快的速度存储数据并读取数据.
  • 完全无故障且易于扩展.
  • 能够搜索数据以进行 Analytics.

我最终得到了一个简短的列表:Cassandra 和 Elasticsearch

I ended up with a short list of: Cassandra and Elasticsearch

据我所知,Cassandra 对我来说是一个完美的 NoSQL 存储解决方案,因为我可以使用索引写入数据和读取数据.它失败或可能失败的地方在于分析.将来,如果我想从 from_date 到 to_date 获取数据,或者更多获取数据用于分析的方法,如果我没有正确设计数据模型或保持长远眼光,这可能是在瞬息万变的世界中相当艰难.

What I do understand is Cassandra is a perfect NoSQL storage solution for me, as I can write data and read data using indexes. Where it fails or it could fail is on Analytics. In the future, if I want to get data from from_date to to_date, or more ways to get data for analytics, if I don't design the Data model properly or keeping long term sight, which might be quite hard in ever changing world.

Elastic Search 最擅长索引(由 Lucene 支持),并且可以通过抛出一些随机文本来随机搜索数据.但是,即使我想检索数据 from_date 到 to_date(我希望它可能是),它的工作原理是否相同.但真正的问题是,它是搜索引擎,还是像 Cassandra 那样完美的 NoSQL 数据存储?如果是,为什么我们还需要 Cassandra?

While Elastic Search is best at indexing (backed by Lucene), and can search the data randomly by throwing some random text. But does it work the same for even if I want to retrieve data from_date to to_date (I expect it might be). But the real question is, is it a Search Engine, or perfect NoSQL data storage like Cassandra? If yes, why do we still need Cassandra?

如果这两个在不同的世界,请解释一下!我们如何将它们结合起来以获得更有效的解决方案?

If both of these are in different world, please explain that! How do we combine them to get a more effective solution?

推荐答案

我们的一个应用程序使用存储在 Cassandra 和 ElasticSearch 中的数据.我们尽可能使用 Cassandra 来访问这些记录,并将数据复制到旨在满足特定应用程序端请求的查询表中.对于比我们的查询表允许的更自由的搜索,ElasticSearch 可以很好地执行该功能.

One of our applications uses data that is stored into both Cassandra and ElasticSearch. We use Cassandra to access those records whenever we can, and have data duplicated into query tables designed to adhere to specific application-side requests. For a more liberal search than our query tables can allow, ElasticSearch performs that functionality nicely.

我们问过同样的问题(针对我们自己)...为什么我们不从 ElasticSearch 中获取所有内容?"

We have asked that same question (of ourselves)..."Why don't we just get everything from ElastsicSearch?"

答案是 ElasticSearch 被设计成一个搜索引擎,而不是一个持久的数据存储.有时 ElasticSearch 会丢失写入.在 ElasticSearch 中,架构更改很难在不清除所有内容并重新加载的情况下进行.为此,我编写了旨在使 ElasticSearch 与我们的 Cassandra 集群保持同步的作业.还有一个 最近关于 Quora 的讨论关于这个话题,得出了类似的观点.

The answer is that ElasticSearch was designed to be a search engine, and not a persistent data store. Sometimes ElasticSearch loses writes. Schema changes are difficult to do in ElasticSearch without blowing everything away and reloading. For that purpose, I have written jobs that are designed to keep ElasticSearch in-sync with our Cassandra cluster. There was also a fairly recent discussion on Quora about this topic, that yielded similar points.

话虽如此,ElasticSearch 作为搜索引擎很棒.Cassandra 作为一个可扩展的高性能数据存储区非常.但是查询数据不同于搜索数据.有时我们需要其中之一,而将两者结合使用非常适合我们的应用程序.它可能(也可能不)适合您.

That being said, ElasticSearch works great as a search engine. And Cassandra works great as a scalable, high-performance datastore. But querying data is different from searching for data. There are times that we need one or the other, and a combination of the two works well for our application. It may (or it may not) work well for yours.

至于分析,我在使用 Cassandra Spark 连接器来处理更复杂的 OLAP 查询方面取得了一些成功.希望有所帮助.

As for analytics, I have had some success in using the Cassandra Spark connector, to serve more complex OLAP queries. Hope that helps.

编辑 20200421

我已经为类似问题写了一个更新的答案:

I've written a newer answer to a similar question:

ElasticSearch 与 ElasticSearch+Cassandra

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

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