reverb does not need to be on the same server, and since it runs continuously it would be best on a small provisioned server rather than dynamically provisioned instance. Alternatively use a third party, eg pusher.
Implementing websockets to super fast communication between front and back
Hi there!
I am trying to find a way to make my backend and frontend communicate extremely fast. Here is my scenario :
We are updating an invoicing software, backend is with Laravel and frontend with VueJS. API in GraphQL. Until now, we had calculation logics (total, taxes, promotion) done in frontend and in backend. When user is creating the invoice, calculation is done on the front, when invoice comes from another platform, calculation is done in the back. That forces us to duplicate 2 calculation logics, this is not good. Plus, we are adding a lot of data to that calculation so it is going to be heavy for the frontend to handle. We want to backend to handle all this.
What we don't want, is to have an unresponsive UI where each time the user makes a modification in the form, a request is sent to the backend via GraphQL or REST.
So we were thinking of websockets (i am new with this). Locally, I installed Reverb, and it was working really great. I could ask the backend from the frontend to calculate the total of the document. Super fast, even with massive amount of data. But .... We are hosting on Laravel Vapor, where Reverb doesn't work ! So that solution with Reverb is not viable.
I installed Soketi on another server, this is working great to send data from the backend to the frontend, but on the other side, I have difficulties. I manage to send the event from the front to Soketi, but it stops there. I could send webhooks or an http request, and then emit the event from the backend to update the front via websocket, but that would defeat the purpose.
If you have some idea that would help me, that would be great :)
Thanks! Edouard
Please or to participate in this conversation.