[erlang-questions] sending data down the wire in mysql vs. mnesia

Paul Mineiro paul-trapexit@REDACTED
Mon Dec 3 07:10:36 CET 2007


The mnesia access API seems to low level to pull this off, since it
intercepts individual reads and writes.

What I'd like is something like rpc:pmap/3 for mnesia (fragmented tables);
in this case I can't hand roll it because the transaction context does not
carry over through an rpc:call (and its not clear how the side effect of
doing an rpc call interacts with transaction retry mechanism anyway;
seems like mnesia should be aware of this explicitly for it to work out).

What I can do right now is use the rpc module to call mnesia:activity for
me on the remote nodes, and the reduce the collection of results.  This is
ok but 1) I have to figure out where the active replicas are for the
fragments I care about so location transparency is gone and 2) I can't
have a single transaction for all the activity.

-- p

On Sun, 2 Dec 2007, Ulf Wiger wrote:

> 2007/12/1, Paul Mineiro <paul-trapexit@REDACTED>:
> > With a fragmented MySQL table, I can execute a stored procedure
> > on each MySQL fragment, and the reduce the collection of results in the
> > client.  The only thing that travels over the wire is the collection of
> > results, one for each fragment.
> >
> > I'm looking for something similar from Mnesia.  Erlang has all the
> > building blocks to put it together (so I have), but I can see an
> > opportunity to come up with something standard within Mnesia which is
> > reasonably general and would return me to a more location-transparent
> > style of programming.
>
> You can modify mnesia_frag and tell mnesia to use your version instead
> of the default. How to do this is documented in mnesia. The downside is
> of course that you'd have to duplicate/maintain a whole bunch of other logic
> as well, just to make this small change, but in the process of doing this,
> you may arrive at some suggestion on how to make this parameterizable.
>
> BR,
> Ulf W
>

Optimism is an essential ingredient of innovation. How else can the
individual favor change over security?

  -- Robert Noyce



More information about the erlang-questions mailing list