Search code examples
node.jscassandrapm2

How to connect to a Cassandra across Pm2 multiple Node.js instances


I want to run my software with Pm2 cluster mode with a single Cassandra instance. When the Node.js instances will start then every single instance will create a Cassandra connection pool.

I think this will cause problems.

What would be the best practice in this case?


Solution

  • This isn't going to be a problem at all. Cassandra is designed to handle connections from multiple clients.

    In fact, it is best practice to have multiple client/app instances instead of just one so you can maximise the throughput of the cluster. Cheers!