Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

C++ in-memory Key-Value stores

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 that can scale without any problems to about 100mill key-value pairs and that are compatible/compilable on linux and win32/64

like image 516
Hippicoder Avatar asked Jun 26 '10 04:06

Hippicoder


3 Answers

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

like image 194
Gunslinger47 Avatar answered Sep 29 '22 23:09

Gunslinger47


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.

like image 43
Peter Popov Avatar answered Sep 29 '22 23:09

Peter Popov


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

like image 31
AviD Avatar answered Sep 30 '22 00:09

AviD