[erlang-questions] Four ways to start mnesia in OTP environment. Which one should one use?

Sergey Samokhin <>
Sun Jul 5 20:34:27 CEST 2009


Hello, Ulf.

> The conventional way to deal with this is to require
> an explicit install phase.

I'll try it, thanks!

> The 'builder' contrib that I wrote years ago addressed that, and I
> believe that Sinan/Faxien does that too. http://www.erlware.org

Thanks again! :]

> This sounds like you really have two independent applications
> that do /not/ need to run in the same VM.

Yeah, it is (details are below). It looks like I don't have to stop
mnesia when an app is terminating.

> Why do you want to reuse the VM instance?
> I'd shut down the erlang node in an orderly fashion, and
> start a new one, using a different boot script and
> a different mnesia dir.

Let me explain what I was thinking about when writing the first letter:

Let's suppose you need to write a few applications which are supposed
to work in a cluster and be added/removed regardless of which
applications are already running: 'FrontEnd', 'BackEnd',
'WebInterface', 'Monitoring'. The obvious solution to make a cluster
is by using mnesia as a kind of foundation.

{first_machine, ['FrontEnd', 'WebInterface']}
{second_machine, ['BackEnd', 'Monitoring']}

Next question is "How should I split applications across VMs?"

There are two answers:

*one VM - one application*
That is what I'm using now. I.e. all applications are started in their own VMs

vs

*One VM - many applications*
I've never tried it, but maybe it's a more convenient way? And here it
would be cool to stop all the dependencies of an application (but not
mnesia, because it's used to connect nodes together).

-- 
Sergey Samokhin


More information about the erlang-questions mailing list