简体   繁体   English

我们应该对业务逻辑使用弹性搜索吗?

[英]Should we use elastic search for business logic?

I have a jhipster app with Cassandra as the database. 我有一个以Cassandra作为数据库的jhipster应用程序。 Also, along with Cassandra, I'm using elastic search. 另外,我与Cassandra一起使用了弹性搜索。 Currently, I am using it for all the searching and data fetching mechanism. 目前,我正在将其用于所有搜索和数据获取机制。 But recently I have read somewhere that we shouldn't use elastic search for business logic. 但是最近我在某处读到,我们不应该对业务逻辑使用弹性搜索。 So should I use it for searching purpose only or is it ok to fetch data using elastic search. 因此,我应该仅将其用于搜索目的,还是可以使用弹性搜索来获取数据。 Please note I am not using elasandra. 请注意,我没有使用elasandra。 We are storing data in Cassandra as well as in the elastic search for indexing purpose. 我们将数据存储在Cassandra以及用于索引目的的弹性搜索中。

Elastic search version: 5.6.3 Cassandra version: 3.0.2 弹性搜索版本:5.6.3卡桑德拉版本:3.0.2

Your question is actually slightly misleading, but you still have 2 very good questions here. 您的问题实际上有点误导,但这里您仍然有2个非常好的问题。 The main confusion comes from your use of the term "Business Logic" so I want to clarify that slightly first, and then answer your actual question. 主要的混淆来自于您对“业务逻辑”一词的使用,因此我想先稍微澄清一下,然后再回答您的实际问题。

First, business logic (aka domain logic) is the set of rules that determines how your data can be created, stored and/or changed. 首先,业务逻辑(也称为域逻辑)是一组规则,这些规则确定如何创建,存储和/或更改数据。 In your stack, this would be handled by the Spring code. 在您的堆栈中,这将由Spring代码处理。 So, no, Elasticsearch should not be handling the actual business logic. 因此,不,Elasticsearch不应该处理实际的业务逻辑。

But the actual question you are asking is should Elasticsearch be used for data retrieval as well as searching? 但是您要问的实际问题是,Elasticsearch应该用于数据检索还是搜索? Elasticsearch actually makes a great data store (although I strongly suggest using it only as a secondary data store and focus on basic search and fetching). Elasticsearch实际上是一个很好的数据存储(尽管我强烈建议仅将其用作辅助数据存储,并专注于基本搜索和获取)。 Using Cassandra as your primary data store, and then using Elasticsearch to quickly fetch pieces of the data is a good design practice, so carry on! 使用Cassandra作为主要数据存储,然后使用Elasticsearch快速获取数据片段是一种好的设计习惯,请继续!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我们应该使用什么客户端(java或rest)来索引弹性搜索中的数据? - What client (java or rest) we should use for indexing the data in elastic search? 我们是否应该在 JestHttpClient 响应后关闭连接以进行弹性搜索 - Should we not be closing the connection after response in JestHttpClient for elastic search Elastic Search Should 子句 - Elastic Search Should clause 我们应该使用ApacheCXF还是EJB来通信逻辑和Web模块? - Should we use ApacheCXF or EJBs for communicating the logic and web modules? 应该由应用程序的业务逻辑来负担平等吗? - Should equals be burdened by the business logic of the application? 为什么应该将业务逻辑移出JSP? - why business logic should be moved out of JSP? 在使用外观会话Bean时,为什么还要同时使用业务会话Bean? - When using facade session beans, why should we still use business session beans as well? 什么时候可以对业务逻辑使用异常处理? - When is it OK to use exception handling for business logic? 我们在构建 Jhipster 应用程序时如何选择业务逻辑? - How do we choose the business logic when building a Jhipster application? 我们可以在spring数据弹性搜索中使用复合主键映射吗 - Can we use Composite Primary Key Mapping in spring data elastic search
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM