[erlang-questions] Mnesia Erlang OTP Application sharing Schema/tables

Chandru chandrashekhar.mullaparthi@REDACTED
Fri Feb 1 11:21:23 CET 2008


On 01/02/2008, db <masterofquestions@REDACTED> wrote:
> Do I create another separate application that does mnesia schema/table
> initilization and have that mnesia initializing application start first on
> nd1 or nd2?
>

One option is to do this.

Installation phase
==============
* Startup nd1 and nd2 by hand. i.e
erl -sname nd1@REDACTED
erl -sname nd2@REDACTED

* Create the schema and the tables required

* Shutdown the nodes

Normal running phase
==================
* Start up the full node. Applications assume that tables have been
created. If not, they crash and burn.

I used this strategy for a long time but got tierd of the two phase
process. So I built a generic app which figures out if tables have
already been created. If not it creates the required tables (or copies
them from another node in the schema).

Chandru



More information about the erlang-questions mailing list