0

what is the algorithm for a chat?

i made a web chat with php in the simple way i have a database with the fields name , message and is very simple using a form to send the message and save the message in the database , and show it using ajax but somebody tould me that is a comments algorithm , not a chat algorithm

8th Aug 2021, 11:39 PM
Jorge Corante
Jorge Corante - avatar
1 Resposta
+ 3
Though i don't have much knowledge about it but he is right i guess . This is how comments algorithm might work . Chat can be implemented this way but there will be a large amount of connection opening and closing using something like polling(and any connection takes a good amount of time) and all of it can delay things and lead to bad user experience. You should instead look into websockets to implement this chat system.
9th Aug 2021, 12:03 AM
Abhay
Abhay - avatar