So I recently got a project that requires real-time location + chat data streaming, and I wanted to know the right steps to take.
Most articles I've read online state to spawn up multiple servers and set up a load balancer like nginx+pm2.
However, I wanted to make this thing DevOps ready, with CI/CD and best practices, which I am not able to judge from the articles. Containerisation, database optimisation, and everything.
Would love to learn the right way!
Articles about scaling Node are going to recommend pm2 and load balancing because that's how you scale Node. There are plenty of articles here & elsewhere about containerization if you look for those instead; the important thing to remember is that once you have a container that's listening on whatever port and serving content, the fact that it's doing that with Node stops mattering. Same goes for CI/CD and database tuning: the content is out there, and easily found with a little exploration.
Anyway, from 30,000 feet the approach I'd take is to build Docker images as part of CI, deploy them to DockerHub or a private registry, and manage them with Kubernetes, since that's more or less become the default orchestration tool. You'd want to look into high-availability Kubernetes specifically since that involves some extra configuration to avoid single points of failure.