Does opening of multiple lmdb-environments within the same client process has a legitimate use case or is it redundant?

Viewed 506

§1 1 lmdb environment corresponds to one database file on the disk.
§2 Theoretically, the same client process, could call the lmdb-c-api, multiple times, to instantiate different lmdb-environments.

The question is, whether §2 is redundant, or could a client have a legitimate use case for the same.

1 Answers

Here are some use cases, that would probably require an app managing its data, in multiple lmdb-environment-files

  • if the client app needed to differentiate its data, at file system level, as in, two different file system files.

  • thinking that absolutely all of an app's data, stored in a single .mdb file could be like storing all the eggs in the same basket.

  • For security purposes, if all data was present in a single file, it would be at greater risk of exploitation, compared to the case when different pieces of the data were spread across different fs-files.

  • Maybe a client process wouldn't want, one data file to grow beyond an upper bound on bytes, eg 1024MiB, so it would like to create a new filesystem-level-file.

So probably, it's not overkill, to allow a single client process to be able to create multiple lmdb-environment files.

Related