https://lib.rs/crates/concurrent-map
I am using it for a transactional in-memory key-value store experiment.
https://lib.rs/crates/concurrent-map
I am using it for a transactional in-memory key-value store experiment.
> This is an ordered data structure, and supports very high throughput iteration over lexicographically sorted ranges of values. If you are looking for simple point operation performance, you may find a better option among one of the many concurrent hashmap implementations that are floating around. Pay for what you actually use :)
So just use a DBMS, but if you don't want, perhaps this ordered concurrent map.
You said you were using it for a "key-value store". If all you need is a key value lookup, all you need is a hash map.
When it comes to concurrency the difference is even more pronounced because hash maps can have lots of concurrent IO due to working on different parts of memory that are mostly independent of each other while a sorted data structure is going to have to move things around, which means more atomic swapping, which means more chances for collisions or race conditions where other threads are going to have to retry their compare and swaps or back off and try parts of their operation again.