I am in the process of starting a new project with a Node.js app hosted on App Platform for which I will need horizontal scaling.
This app will, among other things, use websockets to communicate with the frontend part.
I saw this post in which the answer state that a correlation strategy must be setup for the websocket communication to work in a multi-instances environment.
Is it still the case? And is there anything particular to do regarding the handshake phase of the connection?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Yes, apps that use websockets will need some sort of correlation strategy if the app is using horizontal scaling.
With websockets once the connection is made you will continue to be directed to the same instance of the app until that connection is broken. So handshakes between instances for established connection isn’t necessary, however, each instance will (likely) need to maintain a list of clients connected to it and use something (eg. pub/sub) to dispatch messages that all of the instances can read and then direct to the appropriate client.s