[erlang-questions] A new backend for Mnesia

Ulf Wiger (TN/EAB) <>
Mon Jun 4 14:04:57 CEST 2007

Joel Reymont wrote:
> I guess I'll have to hack it further since I don't
> have a "log" per se and need only the disc* copy
> that received the write request to dump it.

That's pretty much how the mnesia_dumper module works,
except it has explicit knowledge of how to update 
disc_copies and disc_only copies.

But you basically only need to do this if it's 
important for you to amortize the updates. It might
be important in other cases _not to_, e.g. if you 
have other readers of the custom backend. In that case,
data wouldn't be visible after a commit, but only after
the next log dump, which might result in inconsistencies
at the application level.

> Suppose that all the nodes dump their log to the same 
> database table on some database server. If all the 
> nodes do this for every request than the same
> transaction will be posted by every node which is
> redundant and possibly erroneous.

You have to decide at which level to replicate your 
data. If you have multiple external_copies nodes for
the same table, mnesia will interpret this as you
wanting to replicate the data. Then the backend stores
had better not replicate or otherwise provide a single
image of the data as well.

Ulf W

More information about the erlang-questions mailing list