Transaction protocol

Hakan Mattsson <>
Tue Nov 9 16:53:51 CET 2004


On Thu, 4 Nov 2004, Inswitch Solutions - Erlang Evaluation wrote:

EF> I need to manage transactions between two Erlang nodes connected by an
EF> IP network with firewalls and other network devices in the middle.
EF> - I need to have the transaction parties state synchronised despite of
EF> network failure, any ideas about best standards for this?

There is no best all-purpose standard for this. It depends on what you
want to achieve and how much application specific knowledge you can
make use of. It is much simpler to implement specific recovery
protocols for a certain type of application than a generic one.

EF> - Has someone implemented or used a transaction protocol in Erlang,
EF> such as 2 phase commit, 3 phase comit or other?

Yes, both the 2 phase commit and the 3 phase commit (as well as a few
other) commit protocols are implemented i Mnesia. Take a look at
mnesia_tm:multi_commit/4.

Read also about the "lightweight" (2ph) and "heavyweight" (3ph)
transaction protocols in:

  http://www.erlang.org/~hakan/mnesia_internals_slides.pdf

The hard part is not the implementation of the commit protocol, it is
the recovery of the persistent data when the nodes are re-connected.

/Håkan




More information about the erlang-questions mailing list