U
U
Uno2016-10-23 04:02:40
JavaScript
Uno, 2016-10-23 04:02:40

How to implement a real-time dialog system?

Hello! I am developing a web project alone, a kind of mini social network.
I am implementing a system of dialogues and communication... The structure itself is clear and understandable, the static version is ready.

It’s embarrassing to even talk about refreshing the page in 2016 to look at new posts, right? It was decided to develop real-time message receiving, in general, as, say, in VKontakte.

So far, I've implemented short-pooling, that is, a simple ajax post on setInterval'e every 10 seconds. I do not like this idea, due to the heavy load on the server with a large flow of users, and a large delay between sending and receiving messages. In VK, there is a delay of one or two seconds between them ... I want to achieve the same result. (Obviously, giant data centers, large computing power, but if you theoretically place VC on one server and reduce the number of users to 10 thousand, it will also work)
The currently implemented option is unacceptable, I want to make sure that when large loads are reached, rewrite client and server code 50 times

I've read a lot about long-pooling, web sockets, nodeJS+socketIO bundle, but I don't know where to go, what to do, what technology to choose. Everyone advises differently.

Interested in how this is implemented in real social networks and other highload projects. I would be very happy with a detailed explanation of the client and server parts. Simply, experts in Google send to read mana from and to, but they don’t reach specific explanations of the architecture. Knowing all the letters of the alphabet, one cannot learn to compose meaningful sentences without seeing examples.
But I don’t want to learn 1000 and 1 hieroglyphs for the sake of one sentence.

Plus, I specialize more in backend, so I ask for at least literature that answers my questions.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
X
xmoonlight, 2016-10-23
@Noizefan

Choose any with webSocket.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question