I am currently considering replacing redis with elasticsearch to
simplify the stack and have run into the following 3 use cases:
I am currently using redis for caching. Redis is benchmarked at
around 100,000 GETs per second when querying by key (http://redis.io/
topics/benchmarks). How does ES stack in terms simple GET by _id
performance (assuming real-time get)?
I am currently using redis to store counters (EG: 'foo = foo +
1280' types of commands). Is there any way to implement the concept of
counters in ES with support atomic updates (maybe using the script
command)?
I am currently using redis to store lists for queuing use cases (in
which items are added to a list and then popped off). Can something
like that be effectively implemented in ES?
I am currently considering replacing redis with elasticsearch to
simplify the stack and have run into the following 3 use cases:
I am currently using redis for caching. Redis is benchmarked at
around 100,000 GETs per second when querying by key (http://redis.io/
topics/benchmarks). How does ES stack in terms simple GET by _id
performance (assuming real-time get)?
I am currently using redis to store counters (EG: 'foo = foo +
1280' types of commands). Is there any way to implement the concept of
counters in ES with support atomic updates (maybe using the script
command)?
I am currently using redis to store lists for queuing use cases (in
which items are added to a list and then popped off). Can something
like that be effectively implemented in ES?
the third one could be handled with one index (instead of the list)
and using the _version field to avoid problems (can be used to solve
point 2 as well) when adding or deleting items and sort against a
timestamp or similar.
the other mentioned points are probably better implemented with redis
(there are no transactions in ES) ... you could try point 1 with ES:
but even with a ids-request
100k req/sec seems to be high of course all depends on a lot things
e.g. putting it all into RAM ... let me know how it compares !
I am currently considering replacing redis with elasticsearch to
simplify the stack and have run into the following 3 use cases:
I am currently using redis for caching. Redis is benchmarked at
around 100,000 GETs per second when querying by key (http://redis.io/
topics/benchmarks). How does ES stack in terms simple GET by _id
performance (assuming real-time get)?
I am currently using redis to store counters (EG: 'foo = foo +
1280' types of commands). Is there any way to implement the concept of
counters in ES with support atomic updates (maybe using the script
command)?
I am currently using redis to store lists for queuing use cases (in
which items are added to a list and then popped off). Can something
like that be effectively implemented in ES?
Yes I think using an ES index in association with version should be
able to implement a redis-style list.
In regards to #2 (implementing an atomic counter), according to Elasticsearch Platform — Find real-time answers at scale | Elastic - this
seems to imply that it is only possible to pass in a REPLACEMENT
version value for the current version value, instead of a positive or
negative # to that be added to the existing version number. Or, is
there a way in which an increment by X (EG: +200, -150, etc...) can be
done?
the third one could be handled with one index (instead of the list)
and using the _version field to avoid problems (can be used to solve
point 2 as well) when adding or deleting items and sort against a
timestamp or similar.
the other mentioned points are probably better implemented with redis
(there are no transactions in ES) ... you could try point 1 with ES:
but even with a ids-request
I am currently considering replacing redis with elasticsearch to
simplify the stack and have run into the following 3 use cases:
I am currently using redis for caching. Redis is benchmarked at
around 100,000 GETs per second when querying by key (http://redis.io/
topics/benchmarks). How does ES stack in terms simple GET by _id
performance (assuming real-time get)?
I am currently using redis to store counters (EG: 'foo = foo +
1280' types of commands). Is there any way to implement the concept of
counters in ES with support atomic updates (maybe using the script
command)?
I am currently using redis to store lists for queuing use cases (in
which items are added to a list and then popped off). Can something
like that be effectively implemented in ES?
Well, elasticsearch will definitely be slower than redis, by how much its
hard to say. Realtime get is pretty fast, but still goes to disk.
Versioning can be used to implement atomic updates. You can get the
document you want, change it, and try and index it back with the version you
got, if it succeeds, all is well, if not, you need to retry. Note though,
that the whole document needs to be reindexed...
Yes I think using an ES index in association with version should be
able to implement a redis-style list.
In regards to #2 (implementing an atomic counter), according to Elasticsearch Platform — Find real-time answers at scale | Elastic - this
seems to imply that it is only possible to pass in a REPLACEMENT
version value for the current version value, instead of a positive or
negative # to that be added to the existing version number. Or, is
there a way in which an increment by X (EG: +200, -150, etc...) can be
done?
the third one could be handled with one index (instead of the list)
and using the _version field to avoid problems (can be used to solve
point 2 as well) when adding or deleting items and sort against a
timestamp or similar.
the other mentioned points are probably better implemented with redis
(there are no transactions in ES) ... you could try point 1 with ES:
but even with a ids-request
I am currently considering replacing redis with elasticsearch to
simplify the stack and have run into the following 3 use cases:
I am currently using redis for caching. Redis is benchmarked at
around 100,000 GETs per second when querying by key ( http://redis.io/
topics/benchmarks). How does ES stack in terms simple GET by _id
performance (assuming real-time get)?
I am currently using redis to store counters (EG: 'foo = foo +
1280' types of commands). Is there any way to implement the concept
of
counters in ES with support atomic updates (maybe using the script
command)?
I am currently using redis to store lists for queuing use cases
(in
which items are added to a list and then popped off). Can something
like that be effectively implemented in ES?
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.