I have read a number of articles stating key value stores only require two operations:
set(key, value)get(key)This is fine for a single process, but when you have multiple processes, how does the key value store manage concurrency? I would have thought a version number (E.g., an unsigned integer) used for compare-and-swap style concurrency would be required. E.g., the two operations would be:
set(key, value, version), where version is the condition - a mismatch causes a concurrency error and a successful match causes an increment.get(key) (returning both the value and the version).There is two kind of design. Some are using locks and other are using MultiVersion Concurrency Control.
MVCC achieve concurrency without locks. It can be summed up as:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With