0

as the question title, if crud data directly through elasticsearch without relation database(mysql/postgresql), is there any issue here? i know elasticsearch good at searhing, but if update data frequencies, maybe got bad performance?

if every update-request setRefreshPolicy(IMMEDIATE), maybe got bad performance also?

4
  • what is "frequent" for you? Commented Sep 27, 2021 at 1:42
  • This question is duplicated and was asked quite many times, you can easily search for this topic online. See stackoverflow.com/questions/51639166/… Commented Sep 27, 2021 at 1:50
  • 1
    Does this answer your question? ElasticSearch vs Relational Database Commented Sep 27, 2021 at 1:50
  • Please provide enough code so others can better understand or reproduce the problem. Commented Oct 5, 2021 at 2:24

2 Answers 2

0

ElasticSearch will likely outperform a relational db on similar hardware, though workloads can vary. However, ElasticSearch can do this because it has made certain design decisions that are different than the design decisions of a relational database.

ElasticSearch is eventually consistent. This means that queries immediately after your insert might still get old results. There are things that can be done to mitigate this but nothing will eliminate the possibility.

Prior to version 5.x ElasticSearch was pretty good at losing data when bad things happen the 5.x release was all about making Elastic more robust in those regards, and data loss is no longer the problem it was previously, though potential for data loss still exists, particularly if you make configuration mistakes.

If you frequently modify documents in ElasticSearch you will generate large numbers of deleted documents as every update generates a new document and marks an old document as deleted. Over time those old documents fall off, or you can force the system to clean them out, but if you are doing rapid modifications this could present a problem for you.

Sign up to request clarification or add additional context in comments.

2 Comments

5.X has been EOL for years now, you definitely shouldn't be running it! deleted documents are not necessarily a problem, not sure why you think they are?
Well aware that 5.x is long in the tooth, but the impact of the pre 5.x versions on public opinion of those not using Elastic on a regular basis, I find still impacts the overall sentiment towards Elastic. Those that made up their minds pre 5.x dont know that a change was made. AS for deleted documents, not a problem, just a note. They can be a problem in an extreme scenario. If segment merges are not happening frequently enough due to the ratio of total documents, to the number of modified documents, and the modification rate is high enough, they could see a size impact.
0

The application I am working for is using Elasticsearch as the backend. There are 9 microservices connecting to this backend. Writes are fewer when compared to reads. Our write APIs have a performance requirements of max. 3 seconds.

We have configured 1 second as the refresh interval and always using WAIT_FOR instead of IMMEDIATE and fewer times using NONE in the case of asynchronous updates.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.