Sunday 6 August 2017

How to direct a user to an available websocket server when she logs in to my multi-server Node.js app?

I have seen many realtime apps that do this: When a user logs in she doesn't know which server she will be assigned to. She will just login, do something and logout and that's it. A user won't be interacting with other users on a different server, nor will her details be stored on another server.In the backend I assume the Node.js server will put the user's login details to some queue and then when there is space it will assign this user to an available server (A server that has the lowest ping value or is not full). Because there is a limit number of users on one physical server when the user tries to login to a "full" server it will direct her to another available server.I am using ws module of node.js. Is there any service available for this purpose or do I have to build my own? How difficult would that be if I need to run the same app on different servers and be able to assign users to one of the available servers?

Submitted August 06, 2017 at 11:35AM by tvallday

No comments:

Post a Comment