Friendly speaking, I haven’t used WebSockets before, but now I really need it. It is very likely that I don't understand the technology clearly. Please forgive me if my questions sound foolish.
One big question that bothers me: how can I scale web-socket servers across multiple backend servers?
In my case, I should provide horizontally scaling and fault tolerance. The main purpose is: if one of the backend servers will die this situation shouldn't be a problem.
I attach a picture below which shows servers-structure scheme to make it easier to understand what I mean.
So, I want to establish a connection from front-end of my application by WebSocket to NGINX server's IP. And then I think NGINX will decide to what kind of server request will send. As a result, I would like to open a connection using only one IP address, and inside this should be distributed to different servers. In this case, if one of the servers will crash, it won't affect the performance of the application.
I already tried to use Ratchet, Thruway, and Workerman extensions. And it is pretty simple to use it in one server, but when I need to scale it across multiple server-structure - it becomes a real problem for me.
I hope I managed to explain what I mean :)
How can I achieve it? Which extension is better to use?
I will be very pleased for any information that will help me solve my problem, especially code examples