Erlang multiple mnesia databases in the same application or in a application tree dependency

165 Views Asked by At

To use mnesia, the path on the filesystem to the relative mnesia scheme to be used must be set as the environment variable of the application(application:set_env('path_to_schema')). Now 2 questions arise:

  1. Is there a way to specify 2 different mnesia databases to use within the application?
  2. Let's assume we have 2 different applications that use mnesia. So we have application A using the mnesia scheme in path X and application B using the mnesia scheme in path Y. Now let's assume that application B is used as a dependency on application A and thus A will encompass application B. At that point what happens in terms of using the mnesia database? Will folder X or folder Y be used? Or will they be used independently within the relative application scope?

I thank anyone who answers in advance.

1

There are 1 best solutions below

3
Srijan Choudhary On

No, it's not possible to run two different copies of mnesia on the same erlang node at the same time.