Reputation: 78304
I use redis for frond end web app back but for backend I want to use riak but is not clear if it supports eventual consistency with atomic increments. I would like to do counters but does not have to be as fast as redis. If riak cannot do it, who can? Besides redis of course.
Thanks
Upvotes: 1
Views: 1794
Reputation: 155
This is not possible. There is no way for us to lock a riak key-value pair in order to prevent other processes from incrementing at the same time. Use a different product.
Upvotes: 1
Reputation: 29399
Riak does support atomic commits, but only for a single key/value. What you need to bear in mind is that when you write to Riak you're writing to a cluster that is eventually consistent. There is a chance that you're going to write a value to one node at the same time that something else is writing a value to the same location in another node. Assuming that allow_mult
is set to true
on the bucket, this will result in a conflict at read time which will need to be resolved by your application.
Upvotes: 0