GitHub user mapleFU added a comment to the discussion: We expect kvrocks to 
support MVCC

Intrdocuing mvcc is hard, especially when you have multiple `kvrocks` instance, 
for simplest case, if we want to implement single key mvcc, we need:

1. Generating a new **version** for `k` in kvrocks. Apart from RocksDB's 
`sequence_id`, it should be encoding to RocksDB's key, and generated by a 
`incr` like operation.
2. Calling `set` with the mvcc key.
3. Get a key with **version**, if the key with **version** doesn't exists, the 
query should fallback to the previous version, so version might be encoded in 
big endian.
4. Garbage collection the useless version, which should be set by your cache 
client.

1-3 using `set` and `get` is impossible, so new command should be created. If 
you want multi-key transaction, it would be much more complex, because 
**version** generating would depending on a centralized sequncer or clock-si, 
and garbage collecting them should be much more hard.

I think the key reason in your design is never mvcc, is transaction. Maybe a 
key service like zk or redlock is required when calling `set`,  and getting a 
key should goto the right server.

GitHub link: 
https://github.com/apache/incubator-kvrocks/discussions/905#discussioncomment-3705993

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to