Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

High performance persistent key value store for huge amount of records

The scenario is about 1 billion records. Each record has 1kb data size and is store in SSD. Which kv store can provide best random read performance? It need to reduce disk access to only 1 time per query and all of the data index will be stored in memory.

Redis is fast but it's too expensive to store 1 TB data in memory. LevelDB reads disk several times per query. The closest one I found is fatcache but it's not persistent. It's an SSD-backed memcached.

Any suggestions?

like image 973
avhacker Avatar asked Sep 13 '14 08:09

avhacker


2 Answers

RocksDB might be the choice for you, which is optimized for fast storage like memory and flash-disk, and its highly customizable. If your application is read-only after initial bulk-load, then you can config RocksDB to compact everything in one single big file. In that way, reads are guaranteed to have at most single I/O. However, if your application handles both reads and writes, then in order to have at most one I/O per read, you will need to sacrifice the write performance as you need to config rocksdb to compact very often, and that hurts write performance.

Tuning guide for RocksDB can also be found here.

like image 185
keelar Avatar answered Sep 26 '22 07:09

keelar


You may want to try RocksDB, it's a facebook library which optimized for SSD storage. You can also try Ardb, it's a redis protocol compatible NoSQL DB build on RockDB/LevelDB/LMDB.

like image 27
yinqiwen Avatar answered Sep 26 '22 07:09

yinqiwen