[erlang-questions] Re: Replicating a distributed database

Håkan Mattsson hakan@REDACTED
Fri Dec 11 09:47:13 CET 2009


On Fri, Dec 11, 2009 at 6:05 AM, adam <aduston@REDACTED> wrote:
> Ah, okay, got it. I somehow missed the node_pool option. I can do
> that, then use add_table_copy with each fragment individually to
> replicate them.

It is simpler than that. You do not need to use mnesia:add_table_copy/3
if you want to create a fragmented table where all fragments are
replicated to 2 given nodes. This command

  mnesia:create_table(f, [{frag_properties, [{n_fragments, 100},
  {n_disc_copies, 2}, {node_pool, [a@REDACTED, b@REDACTED]}]}]).

will create a table with 100 fragments where each fragment will
have 2 replicas (one on node a and the other on node b) with
storage type disc_copies.

/Håkan


More information about the erlang-questions mailing list