Scalable Node.js application architecture Scalable Node.js application architecture javascript javascript

Scalable Node.js application architecture


Okay, this is a lot to go through. First, your separation of concerns is appropriate, you'll need a way for processes to communication, this can be via a Redis instance, or other pub/sub or req/res system (be it redis, kue, zmq, etc). NOTE: You will likely still need to shard your data/message usage if you grow significantly, at least as much as possible. You can alleviate this if you use a more complex message queue system (Rabbit, or other AMQP).

It seems your main concern is process management. In general, if you're using Heroku, you should be able to scale single process per node, but then you'll still need your coordinator node(s) outside. If you are self-hosting (not via heroku or similar) then you should look at pm2 or forever ... You can then bring up multiple instances...

For the most part your logistics/infrastructure issues will vary based on your needs. Not to mention newer strategies involving CI/CD, docker, and others. Or your database use.