SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to program a Collaborative real-time web app?

    I was wondering if anyone had any good starting points for making a web based app that had Collaborative real-time editing.

    The best way I can think of would be to write it with php, mysql and ajax. Where if you edit a block of information in a textbox form, I would then use javascript onBlur or onChange to send an ajax request that then sends a request to a php page that processes the new data and inserts it into mysql.

    But how do I get the new information to update on someone else's browser? I could use javascript set_interval to reupdate the textbox every couple of seconds, but that sounds kind of wasteful?

    Is there a better way? What else should I be thinking about? I would love to hear some ideas.

  2. #2
    Community Advisor silver trophy

    Join Date
    Nov 2006
    Location
    UK
    Posts
    2,551
    Mentioned
    40 Post(s)
    Tagged
    1 Thread(s)
    You might want to consider long polling to reduce the polling frequency substantially (however if you do this, then due to the extended wait per connection, you're better off having your server side logic using a non-blocking system such as node.js)

    Also worth looking at http://github.com/gimite/web-socket-js as a possible way of using socket communications in browsers that don't support web sockets (most of them)

  3. #3
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Eastcoast for the response, I have to be honest out of my own ignorance and amatuerness I really did not understand anything you said. Anyway you can dumb it down for me? What is long polling, non-blocking system , etc.

    Thanks, I am still just learning all this stuff and have had no formal training.

  4. #4
    SitePoint Evangelist
    Join Date
    Aug 2005
    Location
    Winnipeg
    Posts
    498
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Collaborative, yes...real time??? Why?

    Sit in the same room if you want real time and have a policy of shouting changes a loud so everyone hears. :P

    Kidding, but what many remote teams do is use SVN and a hook to notify each member via MSN (or similar) when a commit has been made to the repo. That way you can instantly update your codebase and see changes made in *almost* real time.

    Polling a central server and updating your local copy automatically without approval would be disasterous, IMO.

    Cheers,
    Alex
    The only constant in software is change itself

  5. #5
    SitePoint Zealot
    Join Date
    Jun 2006
    Posts
    107
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    But then I wouldn't be able to watch youtube videos if everyone was shouting at me?
    My curiosity really got started the other day when I was using google docs and so was a co worker and as she updated her doc, I was able to see the changes as well. I thought that was pretty cool and being curious thought i'd investigate.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •