Thank you @ibrahim for comprehensive explanation. I’ve just checked mosuka’s cete package. It looks like it does not handle key versions but I can benefit from it for other issues.
Dealing with managed transactions will bring more problems to be solved and I am not reluctant to dive in it as you mentioned. The quickest and may be a dirty solution is to store versions along with data and that versions will be incremented per key basis while setting a key, so I need a metadata which should hold version with other stuff. Then I can process metadata to derive key version and compare it with given version. This can solve my consistency problem. Please let me know if this can help. I am not trying to invent “etcd” or “consul” again but just want to have an embedded solution to store key value pairs in a consistent manner.
What if a problem occurs in any replica and that one becomes out of sync? I think this must be solved using raft’s internals to deal with these kind of problems, in the end raft watches all commit results of followers. I will definitely simulate those errors to see what happens.
Thank you again.