Theoretically speaking, can't you just cache search results from a SQL query made to the database making it similar to ElastiSearch? I understand you would run into invalidation issues, but what are the fundamental differences between ElastiSearch and a cache like Redis?
Asked
Active
Viewed 1,276 times
0
-
1Do you think that ES is being used for caching? Are you trying to understand ES against Redisearch? – Gibbs Jul 05 '20 at 07:47
-
@Gibbs That may be where my misunderstanding is. It seems like it's just way to achieve speed with search which is why I compared it that way. – Strawberry Jul 05 '20 at 08:00
-
1This thread might also help: https://stackoverflow.com/questions/34386108/caching-vs-indexing/34389625#34389625 – Val Jul 05 '20 at 08:12
1 Answers
1
Elasticsearch is primarily a Search engine optimized to store and retrieve structured or semi-structured data. It takes care of processing structured/semi-structured data, indexes and provides a nice DSL to query data. Oh, and it happens to be super fast :)
A distributed cache like Memcached and Redis ( BTW Redis is not just cache, but a data structure store) primarily stores Key-Value pairs for faster lookup. Think of your local hash table distributed across a bunch of machines.
Two different use cases. If it's just for the cache - Elasticsearch may not be the right choice.

Nirmal
- 1,276
- 8
- 16
-
Follow up question what's the difference between Cache and Data Structure Store. – Ghos3t Oct 12 '22 at 18:03