Closed prashanthellina closed 10 years ago
Hi,
you can create as many database objects as you like.
However each of this database will use its own environment. Having multiple databases sharing the same environment is not supported right now. Do you need multiple databases sharing the same environment ? I could have a look how hard/easy it is to integrate that feature.
I'm working on a server-like wrapper around RocksDB using pyrocksdb - https://github.com/prashanthellina/rocksdbserver.
In this kind of use, it is likely that a single process will host several database objects. For RocksDB documentation, it looks like creating all the database objects from a common Env object can help them in sharing resources like connection pool and block cache.
I thought it would be useful to have support for Env in such cases. It will be great if you can fit support for Env into your roadmap.
Aside from this discussion, please do take a look at my project when you can. Any feedback is most welcome.
Hi, I did a look at the rocksdb source and it seems per default the same env, called 'default', is used. https://github.com/facebook/rocksdb/blob/master/util/options.cc#L157
This is just for your information. Still it makes sense for pyrocksdb to support ENV so that different databases could use different ENVs.
However right now every database uses the same Env.
I did a even closer look. For me it seems there is no way in rocksdb itself to get a independent Env-object. The only way to get a Env* is Env::Default() which returns always the same object.
For now I will close this issue. If rocksdb changes their API you can reopen it again.
Got it. It wasn't obvious from the documentation that a default environment is used. Thanks for clarifying.
As described in https://github.com/facebook/rocksdb/wiki/Rocksdb-Architecture-Guide#support-for-multiple-embedded-databases-in-the-same-process