[erlang-questions] A new backend for Mnesia

Ulf Wiger (TN/EAB) ulf.wiger@REDACTED
Mon Jun 4 12:38:01 CEST 2007


> -----Original Message-----
> From: Joel Reymont [mailto:joelr1@REDACTED] 
> Sent: den 4 juni 2007 12:07
> To: Ulf Wiger (TN/EAB)
> Cc: Erlang Questions
> Subject: Re: [erlang-questions] A new backend for Mnesia
> On Jun 4, 2007, at 10:14 AM, Ulf Wiger (TN/EAB) wrote:
> > There is support for plugging in alternative backends in the RDBMS 
> > contrib
> I have yet to take a look but how is this different from 
> creating new table types?

Yes, the idea was that you specify {external_copies, Nodes}
just as you would specify disc_copies or ram_copies.
Everything else stays the same.

> The issue is that the backend is the same for all Mnesia 
> nodes so all Mnesia nodes in my case have the same table. 
> Following the regular Mnesia approach of committing on all 
> non-ram  nodes I would be committing the same data multiple 
> times to the same backend.

Are you refering to the dumping of the transaction log?

Mnesia commits to all copies, but writes only to the 
transaction log for disc_only_copies. For disc_copies,
the ram_copy part is updated immediately, and the disk
part is refreshed when the transaction log is dumped.

The external_copies tables behave like ram_copies in 
that they are updated immediately upon commit. If you 
have ram_copies on the other nodes, they will behave
pretty much like a cache of the data in the custom
backend, _provided that all writes originate from 
mnesia_. Otherwise, having ram copies of the table
might be a really bad idea.

Ulf W

More information about the erlang-questions mailing list