Answer the question
In order to leave comments, you need to log in
How to properly implement messaging between users?
Prompt how it is more optimum (from the point of view of load of the server) to organize an exchange of messages between users.
For example, private messaging. The user must receive messages without reloading the page, the user must send a message without reloading the page.
Posts cannot be edited, but can be deleted (marked as isDeleted) for a certain period of time after publication.
The user can view all correspondence with the user he needs.
Initially, I thought to make ajax requests every 30 seconds - but I think the server will not be happy with this. In this connection, I ask - how to properly and optimally organize the exchange of messages between users.
The language used is php.
there is another idea - to organize queues (rabbit) rpc, but I don't know if it's right.
Please share your thoughts on this.)
Answer the question
In order to leave comments, you need to log in
The best option in terms of performance is websockets. It can be implemented on ReactPHP (+ libav for example) or node.js with a data bus on zeromq/rabbitmq with the main application (in any case, it will need to be organized).
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question