title: Real time collaborative editing - how does it work?
body: <p>I'm writing an application in which I'd like to have near real time collaborative editing features for documents (Very similar to Google Documents style editing).</p>
  
  <p>I'm aware of how to keep track of cursor position, that's simple. Just poll the server ever half second or second with the current user id, filename, line number and row number which can be stored in a database, and the return value of this polling request is the position of other user's cursors.</p>
  
  <p>What I don't know how to do is update the document in such a way that it won't throw your cursor off and force a full reload as that would be far to slow for my purposes.</p>
  
  <p>This really only has to work in Google Chrome, preferably Firefox as well. I don't need to support any other browser.</p>