R
R
romany42014-08-25 20:46:28
PHP
romany4, 2014-08-25 20:46:28

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

4 answer(s)
S
Sergey, 2014-08-25
Protko @Fesor

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).

A
Alexander Taratin, 2014-08-25
@Taraflex

www.google.com/search?q=websocket+php&oq=websocket...

K
KorsaR-ZN, 2014-08-25
@KorsaR-ZN

Look towards the XMPP protocol.

A
Andrey Grinevich, 2014-08-25
@Derfirm

Websockets may suit you, you can use Node.js

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question