Erlang Ets Tables Between Nodes

I have an ejabberd server with a good amount of custom modules. I have several mnesia tables, and I know that they can be easily copied between nodes without any code changes. I was wondering if there is a similar way with ets tables?

Ideally, it would be nice to have several machines working with exactly the same mnesia and ets data, without having to convert my ets tables to mnesia tables. (And thus rewriting a good amount of code.)

One, although I had rpc: calling the ets tables for each node, but I was not sure what impact this would have on performance.

If anyone has any answers please let me know.

+3
source share
2 answers

No, the contents of the ets table cannot be replicated for you.

Replication (and transaction security) is a function that the mnesia database application introduces; its implementation uses ets for ram_only tables.

+9
source

You can rpc: call the ets tables on the remote node.

But the whole point of mnesia is to fix the problem you are facing: replication

Converting your code to mnesia is a good investment for the future. And although you take risks, you can always use mnesia:ets()to minimize code changes.

+3
source

Source: https://habr.com/ru/post/1723575/


All Articles