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

Paul Mineiro <>
Mon Feb 11 05:15:13 CET 2008


i didn't find any implementations of this idea so i went ahead and did
one.  it's been working although i wouldn't say it's gotten "heavy" use
because we're just a start-up.  hopefully there are no lurking pitfalls. i
just got around to open-sourcing this weekend if anybody's interested.

http://code.google.com/p/fragmentron

-- p

On Sat, 3 Nov 2007, Paul Mineiro wrote:

> 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
>

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