简体   繁体   中英

Should we use elastic search for business logic?

I have a jhipster app with Cassandra as the database. Also, along with Cassandra, I'm using elastic search. 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. We are storing data in Cassandra as well as in the elastic search for indexing purpose.

Elastic search version: 5.6.3 Cassandra version: 3.0.2

Your question is actually slightly misleading, but you still have 2 very good questions here. 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. So, no, Elasticsearch should not be handling the actual business logic.

But the actual question you are asking is should Elasticsearch be used for data retrieval as well as searching? 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). 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!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM