Answer the question
In order to leave comments, you need to log in
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
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 questionAsk a Question
731 491 924 answers to any question