views:

54

answers:

2

Hi,

I'm working on a PHP application and I'm looking for some ideas for a real-time protocol that I can use for:

1) track users status and location within the application (this should be fast!!!) 2) chat system.

I'm looking for something like FMS and its "Shared Objects" where multiple users can subscribe to pieces of information. FMS is expensive and slow for what I need, I would need a widget loaded on each page, requesting a new connection to the FMS server, etc.... slow...

I need something fast, ope source would be perfect!. Something like what Google Waves uses for syncing shared documents.

Any suggestions?

+1  A: 

You need websockets or something similar.

http://www.orbited.org/

"Orbited allows you to write real-time web applications, such as a chat room or instant messaging client, without using external plugins like Flash or Java. It enables streaming networking for JavaScript without loading bars or page refreshes."

You can implement the chat as IRC or Jabber using Orbited.

bobdiaes
+1  A: 

If you are willing to write this in PHP, I'd say you are looking at the wrong technology. There is 2 major problem with PHP and real-time.

  • When you run a PHP application, it is not persistant like Servlet with Java. It is hard and not really adapted to do communication between each connection. You have to use database storage, stream or file to send data between each instance. All of these methods are not very efficient.

  • It is using blocking I/O and this is where it hurts in term of performance and scalability.

You should look at non-blocking I/O technology for web server. They are all event-driven server which is something different from the PHP approach. Here are few example :

HoLyVieR