What I want to do is this:
Create a table ram_copies in node A which resides in a computer with lot of Ram and CPU power
mnesia:create_table(person, [{ram_copies, [node()]},
{frag_properties, [{node_pool, [node()]}, {n_fragments, 10}, {n_ram_copies, 1}]},
{attributes, record_info(fields, person)},
{storage_properties, [{ets, [compressed, {write_concurrency,true}, {read_concurrency,true}]}]}])
And node A starts working this ram_copy table.
At some unspecified time (which may be 1 second or 1 hour) after the node "A" have created the table, create node B on a computer with lots of hard drive, but less RAM and CPU power , to replicate (structure and data) RAM table in the "a" node but disc_only_copies.
The idea is to run critical processes using all the power at node A, and run trivial processes on another node and keep the data synchronized.
Is this possible?
Greetings.
Yes, it is possible.
Let's say we have two nodes;
node_1
which has lots of Disc andnode_2
which has lots of RAM, and we have afoo
table which must bedisc_only_copies
innode_1
andram_copies
innode_2
. The steps are as follows:Node 1:
Node 2:
That's it. Now we can create
foo
table innode_1
:Node 1:
Finally we can check if it is created on both nodes with
mnesia:info/0
:Node 1:
Node 2: