I have a script which queries an API, the input to the script is a unique user ID which will determine what endpoint is queried on the API.
I want to spawn multiple instances of this script for the given X number of users and wondering what is the best solution for this?
I have looked into NodeJS child processes, is this the main way of solving this problem within node, spawning multiple child processes from a main process? Are all these processes then running on one thread I assume as NodeJS is single threaded?
The script that I want to spawn multiple process's of will be running constantly once it is started, querying an API for data every second. I guess it will have to factor in how much compute power I have available but generally how scalable is the child processes way of doing things?
Also in the background would a NodeJS child process be doing the same thing as if I was to run a bash command index.js & and spawn different processes? (Aside from being able to control the child processes then from the main process in NodeJS)