Ensure correctness in riak?

It seems you cannot do transactions in riak. How to ensure the correctness of the data?

Suppose we want to insert comments. In redis, I would do

commentId=incr commentCount
multi
SET comment_post:commentId postId //for later use when we flag comments. We'll need to know where in the db it is
RPUSH post_comment:postId binaryValue //contains commentId in it + comment body
exec

In sql, I insert a new line into the comment table with text and id message. Both use more than one statement. How do I insert a comment body and link the post to the comment in riak, since it has no transactions?

Another problem is that I am modifying the message. How to update message and update tag list after using this tag

+5
source share
1 answer

Riak is, ultimately, a system designed to be written and not having a notion of atomicity; there are no atomic counters or .

: , CRDT Riak 1.4. . Riak 1.4

, Riak, Amazon ; // , . , .

, ( , , commentId "like" , ). , , , . .

commentId . , . (, UUID?), , , links?

If you are interested and want to discuss possible design approaches, please write to us on the riak-users mailing list - all our engineers read it and are always happy to answer questions.

+6
source

All Articles