views:

89

answers:

1

I'm wondering what the technologies and best practices are behind real time collaboration in web interfaces.

An example of this is of course Google Wave. Another is PivotalTracker.com.

I'm particularly interested in any work (frameworks, plugins, etc) people are doing with Ruby on Rails here.

I imagine it would have to use Javascript underneath at some level, but you would need a way to abstract this out. Probably polling the server periodically to see if changes have been made, and also a way to resolve conflicts if in the middle of editing something the server comes back and says someone else has updated it.

Thank you!

+1  A: 

Wave has operational transform that has a nice property of being easily combinable. You have two users, each of them does "something" in the user interface and two "somethings" can be combined into final document. That allows you to skip the problems with conflict resolution.

A nice way to enable real-time updates to state of the app is by using Comet, which is essentially a geeky codename for keeping an alive, long standing, unterminated get/post request to the server, that server finishes and responds to when something happens on the server. It allows sending to the client instantaneous updates without having the client periodically poll.

I can't really say how to abstract this away in javascript/r'n'r, many of the underlying technical details are hard enough and application specific that no framework supports them out of the box.

Marcin
Very cool thanks. By the way, do you know if Gmail is polling or using push? Was curious. The only thing I don't like about comet is that the browser shows the page as continuously loading. Here is an example: http://stream-hub.com/ Thanks!
Brian Armstrong
Both, depending on the context. Gmail is written using Closure (search Google for closure tools), which supports polling through xhr and pushing through iframeio.
Marcin