Thizzer
Thizzer

Reputation: 16673

Cassandra Session Lifetime

I am currently learning the basics of the Cassandra. I am using the Datastax java-driver to experiment with. Now I am currently working out the session structure.

What I am wondering about is how to handle session lifetime. On the following Datastax page I found information about this.

http://www.datastax.com/dev/blog/4-simple-rules-when-using-the-datastax-drivers-for-cassandra

Now the following sentence creates my question.

"Basically you will want to share the same cluster and session instances across your application."

What if I would try to build a REST-webservice which uses Cassandra. What would be considered the 'application' in this instance. Would I have to maintain the session in some sort of instance class while te webservice is running? Or should I create a session on a per-user basis (meaning that in theory multiple sessions could exist at the same time)?

Upvotes: 1

Views: 1030

Answers (1)

Ravindranath Akila
Ravindranath Akila

Reputation: 97

Yes. That would be your application.

Usually, any application running, even within a server, will have some "Main" class which starts up everything. Try to hook it up there.

Upvotes: 2

Related Questions