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?
Thanks,
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!
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
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.