Answer the question
In order to leave comments, you need to log in
How do you like the SockJS / Redis bundle on Node.JS for private messages on the HighLoad project?
Essence:
There is a site with more than 150 thousand uniques per day. Up to 10 thousand people online. The site has a system of dialogues/private messages. Under the primitive AJAX long-polling to the PHP handler with a selection, of course, everything fell into place. It was necessary to implement a more optimal way. Messages must be saved in the SDB (for history and retrieval). We bought a separate server for node.js, came up with the following architecture:
When loading a page with a dialog, messages are taken via the PHP API from MySQL (as a history).
The client subscribes via SockJS to the server with NodeJS to the stream from Redis of this channel (dialog).
When a message is sent, it is duplicated in both Redis (for the opponent's thread) and MySQL (for the history).
The opponent receives a message from a stream in Redis in real-time.
A benchmark was made for 1000 connections with a flow of 10 messages per second for each. The server calmly withstood, the node took no more than 50 MB of RAM along with the OS. Total server 64 GB.
Now, actually, questions:
1) How good is this bike?
2) How to identify interlocutors on the node server and make a channel only for them?
3) How secure is it in terms of confidentiality of correspondence?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question