3 ms·
Fun stuff. What's the strategy for shared models? If I make changes based on a model that I've read from my local cache ... while someone else edits the same m
by jashkenas 15y ago
Fun stuff. What's the strategy for shared models?
If I make changes based on a model that I've read from my local cache ... while someone else edits the same model on the server ... how does that reconcile when I try later on to make a change?
- lucian1900 15y agoNo strategy at all. For what we're using it conflicts are impossible, so the last write always wins.
- silverlight 15y agoI've started using ShareJS[1] in a new app recently to handle real-time collaboration where conflicts are likely. It's spearheaded by an ex-Google Wave engineer and uses Operational Transformation principles to handle automatic merges. I've been thinking for a little bit now that it would awesome to build a Backbone sync system that could cache things locally when the user is offline, then seamlessly handle bringing them back in sync with ShareJS. [1] https://github.com/josephg/ShareJS https://github.com/josephg/ShareJS
- fooandbarify 15y agoThis is intriguing. I've spent a bit of time building Backbone projects that sync with the server (eg. https://github.com/napoleond/localModel https://github.com/napoleond/localModel) but until now have always resolved conflicts by choosing the model with the most recent time modified. (I have also played a bit with using WebSockets to keep the models up to date for every concurrent user, although that was mostly just for fun.) It would be way better to actually merge diffs in an intelligent manner, though. Thanks for the link!