Real time notification

Hi all, in my application providing online tutoring - student and tutor. When student search a tutor and tutor is online, student can send a request to tutor. So tutor need a confirmation/notification for start a session. How can implement this in php web applications?

Create a record in db with confirmation/notification to start a session.

And check the new records repeatly, for example by ajax. The second way is to use websocketes. The third way is using a dedicated online service like

Any working model for this?

Anyone ?

What you don’t get about previous post. In a more expecific way please…

The idea is written above. If you want to get the working code, sorry I haven’t. As Fabrizio said, you might create a table ie. session and keep the incomings over there. Then check by ajax if new record has been added, if yes - put the notification to the “subscriber”. As simple as it could be. It’s just a few lines of code so I think writting it takes less time than looking for a ready to use solution.



Is this ajax method is best way for 10k users? Can we use node js for this notification sysytem?

You may use whatever you want if it’s scalable. Even ajax requests, but then you have to have separate servers with loadbalancing only for messaging purpouses. It’s a quite infrastructure. If you are interested in setup the infrastructure just PM me. I know the guy who is able to do that.

I would use