How to use Elasticsearch (how to use it, backup, etc.)

Asked 2 months ago, Updated 2 months ago, 2 views

Additional
As Take88 pointed out, I would like to make the content more limited.
1, Is the data backup for el search the same as mysql and safe to use?
2, Is it common to use it for anything other than a full-text search?

Example
Using el to save the number of good articles
If I were to save the number of good in mysql and save the state of good (good or not) for each user,

post_id/count
1 / 123
2 / 12
3 / 22

post_id /voted_user_id /voted_date 
1 / 2 / 2018-11-02 00:00:00
2 / 2 / 2018-11-02 00:00:01
2 / 3 / 2018-11-02 00:00:02

I think it will be like this, but if you want to add, delete, update, or confirm data to this table
Compared to Redis and others, the speed is slower, and it may become a problem when dealing with tens of millions of data.
However, in the case of Redis, if you set it to aof due to persistence issues, it will be about 100 times slower than normal redis operation, so why don't you do the same with el?Wouldn't it be possible to eliminate the speed problem rather than mysql and produce the same performance as Redis?That's what I thought.
Is there no problem with using this method with el?Is it a good way?

I would appreciate it if you could tell me about the above two points.Thank you for your cooperation.

First question
Recently, I started to touch Elasticsearch, but I have implemented full-text searches in groonga and mysql.
Considering safety and ease of use management as a datastore, I somehow thought mysql would be better.
I think it would be best to save the normal data to mysql once and then pour it into Elasticsearch.
I would like to know if this recognition is correct.
If Elasticseach alone is not a problem at all, how does it change compared to mysql's case such as backup and operation?
Also, for example, if you want to aggregate, redis sorted
I think it would be faster to use the set or Elasticseach aggregation, but I'm worried if the data loss is okay.
Please let me know if you think this operation is a best practice. Thank you for your cooperation.

elasticsearch

2022-09-30 11:09

2 Answers

I've heard that Elasticsearch's ability to persist was not as strong as other persistent storage.

At a minimum, we recommend that you persist in databases such as mysql for legitimate application data.I've never heard of best practices, or rather persistent data that exists only in Elasticsearch. (Maybe I'm just ignorant...)


2022-09-30 11:09

1, Is the data backup for el search the same as mysql and safe to use?

We can't guarantee a bug, but if it's a backup that's been successfully retrieved in the correct state, it can be restored without any problems.Ideally, backup should be multiple sources, preferably OS backup, index snapshot, and operation log.

I think it's important to keep historical information about the operation log so that if something happens, it can be returned from the history (image to be restored from what Mysql calls binary logs).

Also, monitoring the status and deploying clusters and replicas should be considered according to your requirements.

2, Is it common to use it for anything other than a full-text search?

Elasticsearch sometimes searches Elasticsearch for data to be plotted on a graph on a dashboard screen.I think it can be used for other searches and aggregation processing.

However, I don't know if it's more than Redis, so I think it's necessary to verify it.

It has a wide range of applications and a wide variety of configurations, so I recommend that you try various things to see what Elasticsearch can do first.


2022-09-30 11:09

If you have any answers or tips


© 2022 OneMinuteCode. All rights reserved.