I am trying to learn GO language. In my small project, making Cassandra DB connection but its taking more time to create session.
I want to create persistent connection so that from next hit, connection time will be equal to negligible.
Is any method to create persistent connection?
Cassandra connection code is below:
cluster := gocql.NewCluster("cluseter_ip")
pass := gocql.PasswordAuthenticator{"username", "password"}
cluster.Keyspace = "keyspace_name"
cluster.Authenticator = pass
cluster.Consistency = gocql.One
cluster.Port = 9042 // default port
cluster.NumConns = 1
session, _ := cluster.CreateSession()