11

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?

avhacker
  • 667
  • 1
  • 9
  • 20

4 Answers4

10

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.

keelar
  • 5,814
  • 7
  • 40
  • 79
2

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.

yinqiwen
  • 604
  • 6
  • 6
1

Have you looked at aerospike ? I haven't use it, but they claim to have good performances on SSD.

Pixou
  • 1,719
  • 13
  • 23
0

LMDB is faster than RocksDB and uses 1/3rd as much memory. Also LMDb requires no tuning; RocksDB requires careful tuning of over 40 parameters to get performance that approaches LMDB's.

http://www.lmdb.tech/bench/inmem/scaling.html

Also LMDB is fully transactional and 100% crash-proof, RocksDB is neither.

hyc
  • 1,387
  • 8
  • 22
  • 1
    I compared RocksDB and LMDB. In my test environment, RocksDB wins. – avhacker Sep 25 '14 at 10:22
  • 4
    I guess that LMDB will win when all the data can be loaded in memory. Here's my test environment: 4GB RAM VM, 10M records, each record has the key of size 16 bytes and value of size 1024 bytes. You can see that that data size is at least 10GB. I tried random read repeatedly in the test set several times and RocksDB always wins. – avhacker Sep 25 '14 at 10:28
  • Sure it depends on the size of values. See this new on-disk benchmark report: http://symas.com/mdb/ondisk/ – hyc Nov 29 '14 at 23:19
  • @hyc Is RocksDB really non-ACID? – eonil Nov 12 '16 at 14:31
  • In 2014 it was. I believe they claim to have added ACID txns this year. – hyc Nov 12 '16 at 16:37
  • The lmdb links in this post are all broken. – kawing-chiu Mar 22 '17 at 09:24