[erlang-questions] Combining ets and mnesia operations for extremeperformance

Paul Fisher <>
Fri Sep 12 18:48:22 CEST 2008


Paulo Sérgio Almeida wrote:
> Hi Ulf,
> 
> Thanks for the prompt reply. See below.
> 
> Ulf Wiger (TN/EAB) wrote:
>> Perhaps you'd want to consider using ram_copies and dumping
>> to disk using mnesia:dump_tables(Tabs)?
> 
> There is not much information about this operation. Does it provide
> atomicity? What happens if there is a crash in the middle of it? I have
> not made it clear, but I need to persist the updates on several tables
> as an atomic operation.

As a general strategy for this type of thing I will do the dump (usually 
ets tables with ets:tab2file/1) and one the operation is complete i will 
rename the file from <file>.tmp to <file> in order to "commit" the 
operation for later recovery.


--
paul



More information about the erlang-questions mailing list