Mugen
Mugen

Reputation: 9095

Save RocksDB stored values between runs

My C++ app is using RocksDB to store in-memory key-value sets.

At some points, I want my app to be able to keep the DB values until its next run. Meaning, the program will shut down, start again and read the same values from the DB as it had before it shut down.

What would be the quickest and simplest way to achieve this?

I found the following article for backup & restore routine - https://github.com/facebook/rocksdb/wiki/How-to-backup-RocksDB%3F, but maybe its an overkill?

Upvotes: 0

Views: 621

Answers (2)

Prateek Jain
Prateek Jain

Reputation: 161

Adding to what yinqiwen said, RocksDB was not meant to be just an in memory data store. It works really well with a variety of storage types. And it is especially good in terms of performance when it comes to flash storage. You may use a variety of RocksDB Options to experiment with what configuration is best to use for your workload, but for most cases, even with the default settings for the persistent storage types, rocks db should work just fine.

Upvotes: 1

yinqiwen
yinqiwen

Reputation: 659

rocksdb already provide some ways to persist in-memory RocksDB database. u can see this link to conigure your rocksdb. http://rocksdb.org/blog/245/how-to-persist-in-memory-rocksdb-database/

Upvotes: 2

Related Questions