It's a lot simpler to just have the socket, with a notification when your PUT has landed. This is what Meteor does.<p>I don't see anything I recognize as eventual consistency in the traditional sense. It sounds like the client is just trying to receive a stream of updates, which could have been made by a single writer, and the only consistency issues are caused by the different overlapping mechanisms for getting updates.
Are there any "standard" models for treating a realtime web app as just another distributed database node (with, of course, extra security precautions and having to do server-side data re-validation)? I'm aware of CouchDB/PouchDB and Meteor's use of mini-Mongo client-side. Are there others?
I hadn't seen the merge / fill idea before. Worth reading to get more ideas on this subject.<p>OT but seems like a good time to ask, does anyone have any experience with Operational Transformations for dealing with syncing in web apps? I've started throwing the idea around for a web app I'm building and it seems like a really interesting pattern. The only real implementation I can find is in sharejs [1]. I work with python on the backend and I can't really find an implementation of it (though for my constrained use-case I can generate good enough code to do it myself).<p>It seems like a good approach but there's very little in the way of libraries implementing it, so I was wondering if it's somehow problematic.<p>[1] <a href="http://sharejs.org/" rel="nofollow">http://sharejs.org/</a>
I've had a lot of success with embedding initial content for a page as JSON in a script tag with a specific ID and a type of "application/json". This way you can rely on the content being there and sidestep the whole timing issue completely. You can potentially speed up your loading time as well, if you have a bunch of things you'd usually fire additional requests off for.<p>I believe I got this idea from Backbone's documentation [1] originally, but I've seen it mentioned in other places as well.<p>[1]: <a href="http://backbonejs.org/#FAQ-bootstrap" rel="nofollow">http://backbonejs.org/#FAQ-bootstrap</a>
The Errai J2EE framework for GWT has an 'Operational Transform Eventually Consistent" Web Socket bus implementation for those curious. (<a href="https://github.com/errai/errai/tree/master/errai-otec" rel="nofollow">https://github.com/errai/errai/tree/master/errai-otec</a>) Demo video: <a href="https://www.youtube.com/watch?v=ChCasRr0cZc" rel="nofollow">https://www.youtube.com/watch?v=ChCasRr0cZc</a>