[erlang-questions] MNESIA ram-only

Roberto Ostinelli roberto@REDACTED
Mon Mar 9 16:11:01 CET 2015


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20150309/e18556b7/attachment.htm>


More information about the erlang-questions mailing list