4 ms·
I have seen plenty of local-machine fast key-value stores, such as LevelDB (By Google), or RocksDB (By Facebook), but I have a hard time imagining what they are
by Nican 8y ago
I have seen plenty of local-machine fast key-value stores, such as LevelDB (By Google), or RocksDB (By Facebook), but I have a hard time imagining what they are for.
What are the use cases for such a library?
- DSingularity 8y agoImagine you want to run a service. This service needs to maintain some intermediate state. This state might’ve frequently read. There might be little value in persisting this state. Also, your service is used by many users, so this state can grow to be pretty big. For example, contents of a shopping cart. One solution is to maintain such state in some key-value store. Different functions of your service can query this state within the data center and never have to suffer disk delays - which are often much longer than the internal network of your data center.
- wiradikusuma 8y agoI think it's an in-memory embedded library, so why not just use a global variable map/dictionary?
- seabrookmx 8y ago> so this state might grow pretty big As mentioned by the comment you replied to, it's because FASTER (and similar libraries) allow persisting this to disk in an efficient manner. If it can fit in memory and your language/framework has an efficient hashmap implementation, then you're right.. it's probably not worth using something like this.
- xmichael999 8y agoGreat summary.
- jcelerier 8y agosooo.... what's the difference with your run-of-the-mill hash map / ordered map / whatever ? How does it compare to other maps such as these ones ? https://tessil.github.io/2016/08/29/benchmark-hopscotch-map.html https://tessil.github.io/2016/08/29/benchmark-hopscotch-map....
- hedora 8y agoThey sit under a service you would actually use. For instance, I think mysql can use rocksdb as a storage backend.