I'm building a system where multiple users need to create, view and modify a set of objects concurrently.
- The system is planned to run on a Java server and modern browser clients (I get to pick which ones).
- It needs to be robust in face of network and server outages, the user interface must not block for modifications, modifications need to be stored locally and published when connectivity returns.
- Under normal operation changes should replicate with sub-second latency.
- Network latency and bandwidth, cpu resources are unlikely to be big issues, scale is on the order of tens to hundreds of clients.
- The objects can be considered as structures of atomic values and sets of structures (i.e. trees). It seems that references between objects are unnecessary.
- I'm happy with last-write-wins conflict resolution on the attribute level, don't have any particular requirements for snapshot consistency. I would like to report write conflicts through the UI though.
- Initially I'm looking to solve replication between a server and multiple clients. In the future I'll probably need multi-level trees too. Arbitrary replication structures are not necessary, but would make failover or multi-master easier.
The issue that I'm in trouble with is replicating changes to the objects between systems. Distributed concurrency is hard and I'd like to delegate that complexity to someone who knows what he's doing. What libraries/frameworks are out there that would help with the replication part?
I already found XSTM and its mission seems to be almost exactly what I need, but unfortunately the GWT part doesn't seem to be ready yet and the project seems to have an uncertain future.
If there's nothing really useful out there, then I'm looking for ideas on what algorithms would be good for this?
I'm currently thinking of something inspired by DVCS and operational transform. The server would accept change-sets for objects and reject conflicting writes. Clients would track the last known server state and locally made changes, detect conflicts between published changes and local changes and rebase unconflicting local changes on top of received server state.