A
A
ADA M2019-03-04 20:22:58
Chats
ADA M, 2019-03-04 20:22:58

What are the best practices for creating a chat?

Can you please tell me what are the best practices for creating a chat in PHP?
The project will be something like this: there are sellers, there are customers. The client is looking for a product (submits an ad), at the same moment certain sellers receive a notification about this (everything is online). And then the sellers respond and send their offers to the client, who immediately receives them. Well, in fact the same chat, only there are personal data (phone, full name, etc.).
As I recall, websockets have always had security issues. There are other technologies, so I would like to know what is now a good practice when implementing such applications?
And in general, what do ordinary chats on sites write on?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Filatov, 2019-03-05
@adiletmurzaliev

Are you confident in the business model that Clients are ready to sit on the page and wait for the Seller to prepare an offer? Let's imagine that there are 1000 Clients online (which is very few) - but how many Sellers?
I think chasing a real-time system is not necessary.
You can implement it through the event model: a request from the client -> the event went to the sellers -> one assigned it to himself -> prepared an offer -> the event went to the client.
The page on the client side can ping every 5 seconds for new events. This will work both on the side of the Clients and on the side of the Sellers.
And no need to invent chats, etc.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question