[英]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.