mnesia replication

Chandrashekhar Mullaparthi <>
Wed Aug 10 16:14:14 CEST 2005

On 9 Aug 2005, at 21:28, Serge Aleynikov wrote:

> Chandrashekhar Mullaparthi wrote:
>>> Is this a good approach in terms of avoiding extensive locking 
>>> overhead in trying to load multiple tables with preserving 
>>> referential integrity of data accross several tables?
>> Have you considered using sticky locks? They are quite useful if you 
>> are only ever going to write to mnesia on one node at a time.
> I am experimenting with several writing methods including table-level 
> locks, sticky locks, and backup-restore technique (suggested by Vance 
> in one of the former emails), but haven't come to a conclusion yet 
> which technique provides better performance in case of the following 
> mnesia configuration and size of the database of about 700M:
>   Master   -------------- RamCopy1
>   DiskCopy ------+        ...
>     |            |        ...
>     |            +------- RamCopyN
>   Standby
>   DiskCopy
> All writes happen either at the Master or at Standby (if Master is 
> down) node.
> What I need to ensure is that:
> 2. It should be possible to delete table copies of RamCopyK node from 
> the mnesia schema on Master/Standby nodes, while the RamCopyK host is 
> off-line.
You can do this using mnesia:del_table_copy/3

mnesia:del_table_copy(schema, ).

Once you do this you are not supposed to bring back the node  
with it's old database. The results are "undefined" according to the 

> 5. The should be no replication of data between RamCopy nodes, only 
> from Master/Slave to RamCopy nodes.

AFAIK, this is not possible with mnesia. But as long as you are not 
going to perform updates on the RAM copy nodes, there will not be any 
replication traffic between these nodes - it will always be from 
master/slave to the ram copy nodes.

> I am not sure how to deal with #2 and #5...

hope this helps.

More information about the erlang-questions mailing list