Implementation of store using node's native cluster messaging Store for Cluster is an implementation of store using node's native cluster messaging. It provides an easy solution for running server in a node cluster.

  • No dependencies on external services.
  • Module is shipped without, it will use your version of
  • Covered by unit-tests.
$ npm install
var io = require('');
var ClusterStore = require('')(io);
if (cluster.isMaster) {
  // Setup your master and fork workers. 
} else {
  // Start a server, configure it to use ClusterStore. 
  io.listen(port, { store: new ClusterStore() });
  // etc. 

The store requires that a shared-state server is running in the master process. The server is initialized automatically when you require() this module from the master. In the case that your master and workers have separate source files, you must explicitly require this module in your master source file. Optionally, you can call setup() to make it more obvious why you are loading a module that is not used anywhere else.

// master.js 
var cluster = require('cluster');
// etc. 
// configure your cluster 
// fork the workers 
// etc.