[erlang-questions] MNESIA ram-only

Dan Gudmundsson <>
Mon Mar 9 21:19:06 CET 2015


Sure, you do not need to specify schema_location ram since that is the
default if
no schema exists on disc.

Just be sure that all nodes in cluster are in the nodes() list.

/Dan

On Mon, Mar 9, 2015 at 4:11 PM, Roberto Ostinelli <>
wrote:

> Dear list,
> I am starting MNESIA in RAM only mode, with the option [1]:
>
>       -mnesia schema_location ram.
>
> Every time I start a gen_server, I first ensure to add all the other nodes
> in the island like so:
>
>       mnesia:change_config(extra_db_nodes, [node() | nodes()]).
>
> I then create the table I need:
>
>       mnesia:create_table(cometa_online_devices, [
>           {type, set},
>           {ram_copies, [node() | nodes()]},
>           {attributes, record_info(fields, my_record)},
>           {index, [#my_record.pid]},
>           {storage_properties, [{ets, [{read_concurrency, true}]}]}
>       ])
>
> I do so mainly to avoid the hassle of creating a schema. As you can see I
> only use ram tables.
>
> My question here is: is this an appropriate use? What kind of problems may
> I get myself into by not using a disc schema?
>
> Thank you,
> r.
>
>
>
> [1] http://www.erlang.org/doc/apps/mnesia/Mnesia_chap5.html#id76396
>
> _______________________________________________
> erlang-questions mailing list
> 
> http://erlang.org/mailman/listinfo/erlang-questions
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150309/fc634276/attachment.html>


More information about the erlang-questions mailing list