C++ in-memory Key-Value stores

前端 未结 7 1208
猫巷女王i
猫巷女王i 2021-02-06 13:47

I\'m looking for suggestions regarding in-memory key-value store engines or libraries, that have C++ interfaces or that are written in C++.

I\'m looking for solutions t

相关标签:
7条回答
  • 2021-02-06 14:08

    Try Tokyo Cabinet, it supports hashtables and B+trees:

    http://1978th.net/tokyocabinet/

    0 讨论(0)
  • 2021-02-06 14:18

    Try FastDB, though you may get more than you ask for. Tokyo cabinet also seems to support in-memory databases. (Or, backed by file mapped by mmap. With modern operating systems, there's no much difference between "in-ram" database and something mmap'd as the OS caching makes also the latter very efficient).

    0 讨论(0)
  • 2021-02-06 14:23

    How about std::map?
    http://cplusplus.com/reference/stl/map/

    0 讨论(0)
  • 2021-02-06 14:23

    A hash map (also called unordered map) is the best bet for that many pairs. You can find an implementation in Boost and TR1.

    Edit: Some people have questioned the size- if he's got, say, a 64bit server, there's plenty of space for 100million kv pairs.

    0 讨论(0)
  • 2021-02-06 14:26

    If you really need to store such amount of pairs in memory consider this Sparse Hash. It has special implementation which is optimized for low memory consumption.

    0 讨论(0)
  • 2021-02-06 14:26

    std::map is fine given that size of key and value is small and the available memory is large ( for about 100million pairs). If its not the case, and you want to run a program over the key-value pairs, consider using a standard MapReduce API. Map Reduce is specifically meant to be used on distributed systems and process large data specially key-value pairs. Also there are nice C++ APIs for Map Reduce. http://en.wikipedia.org/wiki/MapReduce

    0 讨论(0)
提交回复
热议问题