I'm starting to architect a project with the following requirements:
- The overall system will be distributed across multiple physical nodes on a WAN
- Each node will be using and manipulating a common set of data records
- Operations on these records must be resilient to network outages
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:
- Nodes A and B have connectivity and an empty data set.
- Node A adds record (1, ABC).
- Here, the record sets should transparently synchronize and now node B also has record (1, ABC).
- Network connectivity between them is lost.
- Node A alters the record to (1, DEF).
- Node B (later timestamp) alters the record to (1, GHI).
- 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?
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.