Answer the question
In order to leave comments, you need to log in
Real-time dialog system (WebSockets/Long Polling/REST)?
What is better to use for real-time dialogues on the site?
WebSockets/Long Polling/REST?
And what other technologies are there?
The main task is performance.
Answer the question
In order to leave comments, you need to log in
if old (very old) browsers are not needed, then web sockets
if needed - Long Polling
It's better to use WebSockets now. But in general, from your comment it follows that the problem is in your architecture and not in the choice of protocol. Using WebSockets instead of Long Polling with your architecture will not provide much optimization. Since, apparently, if I understand you correctly, the problem is that your data from the database is selected every 3 seconds for each connection.
3000 thousand SQL queries per hour is 0.8 queries per second which is equivalent to about 3 users online
You need to use a comet server or heavily optimize your bike.
Since you yourself invited me to answer the question, here's some advertising for you :) I can suggest paying attention to my project comet-server.ru where up to 20 people online can use it for free.
There is also a ready-made multifunctional free (Apache License 2.0 license) chat module and several more ready-made solutions
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question