In this article we will explain how you can recover your in-memory RocksDB database even after a machine reboot.

    Options::wal_dir is the directory where RocksDB stores write-ahead log files. If you configure this directory to be on flash or disk, you will not lose current log file on machine reboot.Options::WAL_ttl_seconds is the timeout when we delete the archived log files. If the timeout is non-zero, obsolete log files will be moved to directory under Options::wal_dir. Those archived log files will only be deleted after the specified timeout.

    You should configure the backup process to avoid backing up log files, since they are already stored in persistent storage. To do that, set BackupableDBOptions::backup_log_files to false.

    To reiterate, here's what you have to do: