Search code examples
javascriptnode.jspm2

A single list of users shared between several process using PM2 and Nodejs


What is the best way to have a single list of users which is shared between several processes?. The processes are initiated using PM2.

The processes will have access to the list in order to add, remove, and check if a user exist in the list already.


Solution

  • The easiest way is to use redis(or memocache, even mongodb) to store those user list.

    Or you will have to handle very complex IPC in your case, since pm2 uses node cluter, based on child_process.