Frank Drebin
Frank Drebin

Reputation: 1083

Caching Elastic Search Results in Mysql?

I was wondering if it makes sense to cache ElasticSearch search results in a MySQL Database. Of course not everything (e.g. no autocomplete requests) but maybe search queries/results which get requested very very often.

Or is there a better way to cache directly inside ElasticSearch?

Upvotes: 0

Views: 293

Answers (1)

Amit
Amit

Reputation: 32386

As you have not specified your exact use case and your queries so its difficult to provide the specific answer but in general its not a good idea to cache the response of ES in MySQL and in my personal experience have not seen anyone doing it.

coming to another part of your question

is there a better way to cache directly inside ElasticSearch?

yes, its very much possible and Elasticsearch provides various types of caches like share-request cache or filter cache which is used based on configuration and nature of your query.

You could have a look at cache blog to get more info and ask specific questions if you want to improve the performance of your search queries.

Upvotes: 2

Related Questions