Multiple instances of rockdb

On a multi-core server (or cluster), you want to deploy the rockdb dll on each core that is independent of each other, i.e. does not look for a distributed db. Is it possible?

Each db internal memory requires a runtime storage link, i.e. not on startup or close or are all db operations done in memory?

+3


source to share


1 answer


1) Yes, it is possible. RocksDB is simply a C ++ library that you can compile with your code that manages multiple rockdb instances of a multicore server (or cluster). Multiple rockdb instances can also share the same set of resources (for example, share the same thread pool) using them using the same Env (see Options :: env ).

// Use the specified object to interact with the environment,
// e.g. to read/write files, schedule background work, etc.
// Default: Env::Default()
Env* env;

      



2) if the directory of your rockdb instance is in memory (e.g. install via tmpfs ) then all db operations are guaranteed to run in memory. To make such stones resistant, you can also write-write-ahead to some persistent storage such as a flash drive or disk.

+3


source







All Articles