Implementing horizontal scaling in Node.js project
Course: Horizontal and vertical scaling, Indexes in DBs - chapter 3
You can start multiple node projects then? If there are 8 cores, then just start 8 projects?
node index.jsnode index.jsnode index.jsnode index.jsnode index.jsnode index.jsnode index.jsnode index.jsThis, ofcourse has a lot of problems
- Just ugly to do this, keep track of the processes that are up and down
- Processes will have port conflicts, you’ll have to run each process on a saparate port
This is where the cluster module comes into the picture
$1bNotice different pids in different devices
Browser

Postman

Curl

💡 Try to figure out why there is
stickinessin the browser. Why the request from the same browser goes to the same pid