G__
G__

Reputation: 7111

Does MNesia support synchronization after disconnected operation?

I'm starting to architect a project with the following requirements:

I'm considering utilizing Mnesia/Erlang as the base platform for this project, but I'd like to know how well it (Mnesia) can handle simultaneous disconnected conflicting operations on the data set.

An illustrative scenario:

  1. Nodes A and B have connectivity and an empty data set.
  2. Node A adds record (1, ABC).
    • Here, the record sets should transparently synchronize and now node B also has record (1, ABC).
  3. Network connectivity between them is lost.
  4. Node A alters the record to (1, DEF).
  5. Node B (later timestamp) alters the record to (1, GHI).
  6. Network connectivity is restored
    • Expected: After a transparent synchronization, both nodes contain the record (1, GHI).

To simplify, let's assume that a complete change history is not required (e.g. it's not important that record 1 used to contain ABC or DEF, it's only important that it now contains GHI).

Is this an out-of-the-box (or trivial to implement) capability of Mnesia?

Upvotes: 4

Views: 630

Answers (2)

Adam Lindberg
Adam Lindberg

Reputation: 16577

Ulf Wiger had a talk last Erlang Factory in San Francisco (2010) on this topic. You can find his slides here: http://www.erlang-factory.com/upload/item/7/UlfWiger-10minutetalk.pdf

They contains an overview of the problems and also pointers to some source code that might be of use to you.

Upvotes: 5

0xYUANTI
0xYUANTI

Reputation: 404

Steps 1-5 should work. Automatic conflict resolution (step 6): no.

Upvotes: 2

Related Questions