[erlang-questions] Mnesia distributed fragmented table

Hakan Mattsson <>
Fri Aug 3 16:02:56 CEST 2007

On Fri, 3 Aug 2007, Eranga Udesh wrote:

EU> How do I create a fragmented distributed table in multiple Erlang nodes,
EU> where each node will have the full set of fragments, so that even without
EU> other nodes, that node can run in isolation?
EU> For eg. I want to create test_table distributed in 2 Erlang nodes
EU> ( and ) and with 20 fragments. I need all 20
EU> fragments in , so that even if the  goes down,
EU> still I can use the full database in  When both the nodes
EU> are available, any update to test_table in  will get
EU> reflected in  and vice versa (distributed).

Read about n_fragments, node_pool and n_ram_copies in the
Mnesia Users Guide in the chapter about fragmented tables:


The following create_table command creates a table with
20 fragments where each fragment has a ram_copies
replica on both node  and  

  ()9> mnesia:create_table(t, [{frag_properties, [{n_fragments, 20},
                                                         {node_pool, []},
                                                         {n_ram_copies, 2}]}]).
  ()10> [{T, mnesia:table_info(T, ram_copies)} || T <- mnesia:system_info(tables),
                                                         lists:prefix("t", atom_to_list(T))].


More information about the erlang-questions mailing list