Search code examples
erlangmnesiaredundancy

Erlang: MNesia: Implementing redundancy?


I have an application developed with Erlang / MNesia and I am trying to implement redundancy for MNesia.

I want to add - remove nodes dynamically in runtime and handle synchronization of tables for every new joining node.

What is the best way to implement this using Erlang and MNesia?

Thanks.


Solution

  • You don't need to implement anything - mnesia already has these features. You can add and remove nodes from a mnesia cluster at runtime, add and remove table copies from nodes within the cluster, and mnesia:wait_for_tables/2 will let you cope with synchronization while adding nodes or table copies. Have a look at the mnesia documentation for more information.