[erlang-questions] beginner: mnesia dynamic fragment distribution balancing

Paul Mineiro <>
Sat Nov 3 16:02:55 CET 2007


hi.

i want to set up a fragmented table across a set of nodes with dynamic
membership, and basically maintain a balanced use of resources while
respecting the creation parameters (e.g. n_disc_copies).  it appears
mnesia initially balances the fragments across the set of nodes at create
time but then you are "on your own" as the node pool changes.

i can see how to do this manually by inspecting the table (and each
fragment) with mnesia:table_info/2, and then taking ownership of a replica
with mnesia:add_table_copy/3 and mnesia:del_table_copy/2 as necessary to
achieve balance.

two questions:

1) has somebody done this already?  i don't want to reinvent the wheel.

2) if not, i want to handle the case where multiple nodes are joining
and/or leaving at the same time.  can i serialize this activity using
transaction constructs or should i create a (global) process to
synchronize all this activity through?

thanks,

-- p

Optimism is an essential ingredient of innovation. How else can the
individual favor change over security?

  -- Robert Noyce



More information about the erlang-questions mailing list