tags:

views:

26

answers:

2

I want to implement an application on my website where once the users are connected, they share a text editor. If one user enters anything on the text editor available on his screen, the same text appears on the second user’s screen at the same coordinates.

Same thing goes for the other user. Also there would be pointer shaped images on both user’s screens to represent mouse pointers. When user A moves his mouse pointer, the image on user B’s screen should be moved according to the movement of user A’s mouse and similarly, when user B moves his mouse, the image on user A’s screen should be moved accordingly.

The problem is I am using database to store the coordinates of each user. And this approach results in the a lot of lag and delay. What should I use in place of the database?? Please Help !

A: 

You probably don't want to request the updates but push them to your clients: http://en.wikipedia.org/wiki/Comet_%28programming%29 . This reduces the delay between an update from your client to the server and other clients again checking for updates.

Fge
A: 

how abt using Redis : http://code.google.com/p/redis/

an example of a similar collaborative text editor using this : http://www.web2media.net/laktek/2010/05/25/real-time-collaborative-editing-with-websockets-node-js-redis/

jknair