Is there any advantage to putting each database in it's own environment?

84 views Asked by At

Is there any advantage to creating a separate environment for each database? I gather that all databases in an environment are stored in the same chain of log files, in one directory. I was wondering if using separate environments might speed up cleaning, among other things.

thanks

1

There are 1 answers

0
Vyacheslav Lukianov On

Databases stored in separate environments tend to have better data locality. This can results in faster I/O (both reading and writing) since higher locality rate means better file system caching. Garbage collector (cleaner) can work faster as well, because for each environment it should move less data (which is more local) and it requires less lookups. These advantages might be even more noticeable if separate environments were located on different physical storage devices (HDD, SSD).

Nevertheless, there are some disadvantages. First of all, JE caching will be less efficient. Second, you won't be able to read/update the databases in a single transaction.

So the typical case for storing databases in separate environments is if:

  1. There are no specific requirements for consistency of data stored in different databases, i.e. it can be read/updated more or less successively in several transactions atop of separate environments.
  2. Entire data in all environments doesn't fit in memory, so database operations require some I/O.
  3. Separate environments can be located on separate storage devices.