Cassandra Java Client (Hector) : Using the same cluster and keyspace objects throughout the application

StackOverflow https://stackoverflow.com//questions/22010145

  •  21-12-2019
  •  | 
  •  

Question

I want to know if it is okay to initialize the cluster and keyspace object just once, i.e. at the start of the application and use it throughout the application.

Or shall I create a different object everytime I have to interact with the data store. There maybe multiple parallel reads and writes.

Was it helpful?

Solution

It's definitely OK to use only one cluster/keyspace object in your entire application. Not doing so will actually probably result in a degraded performance.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top