2

I'm looking for some references for building chat app with php

1. With AJAX

I see there are many tutorials using javascript/jquery that use setInterval method to keep calling an ajax method, which used for getting a last inserted data on database and retrieve if any changes.

2. With Ratchet

But i found Ratchet ratchet web , which i believe use websockets.

Does anyone know what is the advantage for 1st and 2nd option, is the 1st option (using ajax) a good option?

MisterCat
  • 1,531
  • 3
  • 13
  • 23

1 Answers1

1
  1. With AJAX
    • Manually you need to maitain the sessions
    • Manually mapping required
    • Its one way

2 With Ratchet Or Websocket

  • Websocket is HTML 5 feature so you should use bcz its latest feature
  • Websocket works based on session for each connection it will be helpful for each chat connection, Just Map the sessions of 2 users ,simple step make your chat application ready
  • Its bi directional data communication
Vinayak Shedgeri
  • 2,222
  • 1
  • 21
  • 24