I am working on a NodeJs based application primarily a Web app written 
using AngularJs/HTML/CSS.
I have a need for running a worker process in my server which will process 
background jobs. Like, sending emails to 100s of staff at the end of the 
day, or processing billing related records etc. Sometimes I also want this 
process to listen to the main NodeJS process that is serving the webui, so 
that the main process can handover the work to the worker for immediate 
processing.

Things I have considered
1) Worker process will run as another NodeJs app (entirely different app, 
no forking, no clustering from the main process).
2) Worker process will open a server socket for listening to the main 
nodejs process for any immediate job delegation.
3) Worker process will poll the database (mongodb) periodically to pick up 
unprocessed records (say, every 5 sec)

Your expert suggestions needed
1) Is the approach explained above viable? 
2) Communicating between the 2 nodejs processes using sockets, is it a 
recommended approach. I may have to move this worker process to a different 
server and may even scale out if required.
3) Is mongodb a good option for implementing a workload queue. My web 
application uses MongoDB as database, so I did not consider moving to a 
different database for the queue. Any suggestions for in-memory queue.

Thank you very much in advance.
Mouli



-- 
Job board: http://jobs.nodejs.org/
New group rules: 
https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/nodejs/72938f05-b1bd-4a51-b087-00e0d035da67%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to