in Technology

Collaborating in web application using SVN

What would you do if you wanted to manage document versions in a web application? You wanted different users to edit a document simultaneously and then for everyone to get the latest copy? Something like Google Docs?

This collaboration need is very similar to how developers use source code control systems. Here’s a typical flow for programmers:

  • Set up a repository for code
  • Add a file
  • Once enough changes are made, commit it to the repository
  • Someone else checks out the same file
  • Two people simultaneously work on the same file
  • They can update their copies to get committed changes from other users
  • Committing their copy to the server will make it the latest copy
  • Occasionally, there will be conflicts if both programmers edit the same section of code. In that case, they manually resolve it and commit the correct copy.

Collaborating on documents (e.g. Google Docs) is very similar. I don’t know what Google Docs uses for its backend?.

But we are planning to use SVN for a similar need!

  • Make a repository of documents
  • User A creates a new document and save it – gets committed
  • User B open it (checkout), changes it and saves it (update + commit)
  • Since we update before commit, changes that other users made will be merged before commit
  • In case of conflict, keep local version, discard server version. (this is not ideal, but helps automate things)

How does it sound?

Write a Comment

Comment

  1. Nirav, very interesting idea. I have been toying with this idea for a few months now, just couldn’t find the resources to implement this.
    The idea was to design an interface for a document management app. And then, implement the interface in ‘drivers’ for various versioning systems. Thus there could be a svn driver, a Hg or Git driver, cvs driver and so on.
    Do send me an email if we can collaborate on this one.