S
S
semki0962020-02-16 01:26:30
Laravel
semki096, 2020-02-16 01:26:30

How to organize data exchange on a service that receives new data every second?

Laravel has built-in support for websockets. Question. Will such a scheme work and will the queue not choke, taking into account the fact that data is received on the socket every second from a third-party api.

The scheme is like this. Data comes to my client, the client writes them to the database. Laravel keeps track of the new entry and queues it up to distribute this data to clients over the socket.

Will Laravel cope with such a task, given that the data comes every second?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
X
xmoonlight, 2020-02-16
@semki096

Knight's move: emulate the base via the web socket server API for your clients.
No delays and complete freedom of action.
Web socket - any.
Laravel is superfluous here.
PS: remember that "cool" is not the presence of the name Laravel (or any other) in your project, but a competent architecture and the choice of the best tools for its implementation within the framework of the task.

P
Philipp, 2020-02-16
@zoonman

Using Laravel for such tasks is a working idea, but not very sensible. As for performance - it all depends on how much money you are willing to spend on infrastructure. And so - it will do just fine if there are up to 1000 customers online. Then you will start having problems with vertical scaling. You can pull a little more, but it will still end at some point.
If you want to keep a lot of connections, then https://nchan.io/ is perfect for you.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question