Elasticsearch as memcache replacement

elasticsearchmemcached

I am looking into replacing memcached with elasticsearch. Basically, I need to reduce my software stack and since I will be using elastic for searching, I was thinking of creating an index that will act as a general cache, where I will be storing various items.

Is there a way to create such a "generic bucket" that can hold different items without elastic complaining? From what I have seen so far, when you store an item the 1st time, elastic automatically creates a type for each key. This can lead to trouble if you try to save a different item which happens to have a key elastic already mapped, with a different value.

Any way of accomplishing the above?

Regards

Best Answer

Elasticsearch is a search and index kind of database, build and optimized for searching and analytics, not for caching.

For a caching server you would use Memcached. But these days there are other alternatives such as Redis (Key-Value database) which is much faster and supports more complex solutions. Carl Zulauf did a great job describing the differences between Redis and Memcached already here on stackoverflow.