You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Kallin Nagelberg <ka...@gmail.com> on 2011/02/01 18:18:32 UTC

cassandra as session store

Hey,
I am currently investigating Cassandra for storing what are
effectively web sessions. Our production environment has about 10 high
end servers behind a load balancer, and we'd like to add distributed
session support. My main concerns are performance, consistency, and
the ability to create unique session keys. The last thing we would
want is users picking up each others sessions. After spending a few
days investigating Cassandra I'm thinking of creating a single
keyspace with a single super-column-family. The scf would store a few
standard columns, and a supercolumn of arbitrary session attributes,
like:

0s809sdf8s908sf90s: {
prop1: x,
created : timestamp,
lastAccessed: timestamp,
prop2: y,
arbirtraryProperties : {
            someRandomProperty1:xxyyzz,
            someRandomProperty2:xxyyzz,
            someRandomProperty3:xxyyzz
}

Does this sound like a reasonable use case? We are on a tight timeline
and I'm currently on the fence about getting something up and running
like this on a tight timeline.

Thanks,
-Kal

Re: cassandra as session store

Posted by Jonathan Ellis <jb...@gmail.com>.
Sounds like you're seeing the bug in 0.7.0 preventing deletion of
non-Data.db files (i.e. your Index.db) post-compaction.  This is fixed
for 0.7.1.  (https://issues.apache.org/jira/browse/CASSANDRA-2059)

On Wed, Feb 2, 2011 at 8:15 AM, Omer van der Horst Jansen
<om...@gmail.com> wrote:
> We're using Cassandra as the back end for a home grown session
> management system. That system was originally built back in 2005 using
> BerkelyDB/Java and a data distribution system that used UDP multicast.
> Maintenance was becoming increasingly painful.
>
> I wrote a prototype replacement service using Cassandra 0.6 but
> decided to wait for the availability of official TTL support in 0.7
> before switching over.
>
> The new system has been running in production now for a little over a
> week. My main issue is that Cassandra is using far more disk space
> than I expected it to. The vast bulk of disk space seems to be used
> for *Index.db files. I'm hoping that the 10-day GCGraceSeconds
> interval that kicks in on Friday will help me there.
>
> Most of our apps that use this service generate their own session
> keys. I assume by hashing and salting a user ID and/or calling
> something like java.util.UUID.randomUUID().
>
> My schema is currently very simple -- there's a single CF containing a
> (binary) payload column and a column that indicates whether or not the
> data has been compressed. We have a few rogue apps that store
> humongous XML documents in the session and compression helps to deal
> with that. That's also why memcached wasn't going to work in our
> scenario.
>
>
>
> On Tue, Feb 1, 2011 at 12:18 PM, Kallin Nagelberg
> <ka...@gmail.com> wrote:
>> Hey,
>> I am currently investigating Cassandra for storing what are
>> effectively web sessions. Our production environment has about 10 high
>> end servers behind a load balancer, and we'd like to add distributed
>> session support. My main concerns are performance, consistency, and
>> the ability to create unique session keys. The last thing we would
>> want is users picking up each others sessions. After spending a few
>> days investigating Cassandra I'm thinking of creating a single
>> keyspace with a single super-column-family. The scf would store a few
>> standard columns, and a supercolumn of arbitrary session attributes,
>> like:
>>
>> 0s809sdf8s908sf90s: {
>> prop1: x,
>> created : timestamp,
>> lastAccessed: timestamp,
>> prop2: y,
>> arbirtraryProperties : {
>>             someRandomProperty1:xxyyzz,
>>             someRandomProperty2:xxyyzz,
>>             someRandomProperty3:xxyyzz
>> }
>>
>> Does this sound like a reasonable use case? We are on a tight timeline
>> and I'm currently on the fence about getting something up and running
>> like this on a tight timeline.
>>
>> Thanks,
>> -Kal
>>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com

Re: cassandra as session store

Posted by Omer van der Horst Jansen <om...@gmail.com>.
We're using Cassandra as the back end for a home grown session
management system. That system was originally built back in 2005 using
BerkelyDB/Java and a data distribution system that used UDP multicast.
Maintenance was becoming increasingly painful.

I wrote a prototype replacement service using Cassandra 0.6 but
decided to wait for the availability of official TTL support in 0.7
before switching over.

The new system has been running in production now for a little over a
week. My main issue is that Cassandra is using far more disk space
than I expected it to. The vast bulk of disk space seems to be used
for *Index.db files. I'm hoping that the 10-day GCGraceSeconds
interval that kicks in on Friday will help me there.

Most of our apps that use this service generate their own session
keys. I assume by hashing and salting a user ID and/or calling
something like java.util.UUID.randomUUID().

My schema is currently very simple -- there's a single CF containing a
(binary) payload column and a column that indicates whether or not the
data has been compressed. We have a few rogue apps that store
humongous XML documents in the session and compression helps to deal
with that. That's also why memcached wasn't going to work in our
scenario.



On Tue, Feb 1, 2011 at 12:18 PM, Kallin Nagelberg
<ka...@gmail.com> wrote:
> Hey,
> I am currently investigating Cassandra for storing what are
> effectively web sessions. Our production environment has about 10 high
> end servers behind a load balancer, and we'd like to add distributed
> session support. My main concerns are performance, consistency, and
> the ability to create unique session keys. The last thing we would
> want is users picking up each others sessions. After spending a few
> days investigating Cassandra I'm thinking of creating a single
> keyspace with a single super-column-family. The scf would store a few
> standard columns, and a supercolumn of arbitrary session attributes,
> like:
>
> 0s809sdf8s908sf90s: {
> prop1: x,
> created : timestamp,
> lastAccessed: timestamp,
> prop2: y,
> arbirtraryProperties : {
>             someRandomProperty1:xxyyzz,
>             someRandomProperty2:xxyyzz,
>             someRandomProperty3:xxyyzz
> }
>
> Does this sound like a reasonable use case? We are on a tight timeline
> and I'm currently on the fence about getting something up and running
> like this on a tight timeline.
>
> Thanks,
> -Kal
>

Re: cassandra as session store

Posted by "Damick, Jeffrey" <Je...@neustar.biz>.
Are you going to use TTLs to expire the session columns automagically? (we're working on something similar as well)


On 2/1/11 12:30 PM, "Roshan Dawrani" <ro...@gmail.com> wrote:

Please do keep this discussion on the mailing list and not take it offline. :-)

I will be in the same boat very soon, I think.

It will be great to hear from people who have already gone down this road and used Cassandra as a session store in a clustered environment.

On Tue, Feb 1, 2011 at 10:56 PM, Kallin Nagelberg <ka...@gmail.com> wrote:
Cool, maybe we can help each other out. I'm using multiple web-apps,
all running in Resin containers. Have you thought about schema or how
to generate sessionIds for cookies?

-Kal

On Tue, Feb 1, 2011 at 12:22 PM, Sasha Dolgy <sd...@gmail.com> wrote:
> I am working on this tonight with jetty as front end and cassandra as
> backend session store.  Hopefully.
>
> On 1 Feb 2011 18:19, "Kallin Nagelberg" <ka...@gmail.com> wrote:
>> Hey,
>> I am currently investigating Cassandra for storing what are
>> effectively web sessions. Our production environment has about 10 high
>> end servers behind a load balancer, and we'd like to add distributed
>> session support. My main concerns are performance, consistency, and
>> the ability to create unique session keys. The last thing we would
>> want is users picking up each others sessions. After spending a few
>> days investigating Cassandra I'm thinking of creating a single
>> keyspace with a single super-column-family. The scf would store a few
>> standard columns, and a supercolumn of arbitrary session attributes,
>> like:
>>
>> 0s809sdf8s908sf90s: {
>> prop1: x,
>> created : timestamp,
>> lastAccessed: timestamp,
>> prop2: y,
>> arbirtraryProperties : {
>>             someRandomProperty1:xxyyzz,
>>             someRandomProperty2:xxyyzz,
>>             someRandomProperty3:xxyyzz
>> }
>>
>> Does this sound like a reasonable use case? We are on a tight timeline
>> and I'm currently on the fence about getting something up and running
>> like this on a tight timeline.
>>
>> Thanks,
>> -Kal
>



Re: cassandra as session store

Posted by Roshan Dawrani <ro...@gmail.com>.
Please do keep this discussion on the mailing list and not take it offline.
:-)

I will be in the same boat very soon, I think.

It will be great to hear from people who have already gone down this road
and used Cassandra as a session store in a clustered environment.

On Tue, Feb 1, 2011 at 10:56 PM, Kallin Nagelberg <
kallin.nagelberg@gmail.com> wrote:

> Cool, maybe we can help each other out. I'm using multiple web-apps,
> all running in Resin containers. Have you thought about schema or how
> to generate sessionIds for cookies?
>
> -Kal
>
> On Tue, Feb 1, 2011 at 12:22 PM, Sasha Dolgy <sd...@gmail.com> wrote:
> > I am working on this tonight with jetty as front end and cassandra as
> > backend session store.  Hopefully.
> >
> > On 1 Feb 2011 18:19, "Kallin Nagelberg" <ka...@gmail.com>
> wrote:
> >> Hey,
> >> I am currently investigating Cassandra for storing what are
> >> effectively web sessions. Our production environment has about 10 high
> >> end servers behind a load balancer, and we'd like to add distributed
> >> session support. My main concerns are performance, consistency, and
> >> the ability to create unique session keys. The last thing we would
> >> want is users picking up each others sessions. After spending a few
> >> days investigating Cassandra I'm thinking of creating a single
> >> keyspace with a single super-column-family. The scf would store a few
> >> standard columns, and a supercolumn of arbitrary session attributes,
> >> like:
> >>
> >> 0s809sdf8s908sf90s: {
> >> prop1: x,
> >> created : timestamp,
> >> lastAccessed: timestamp,
> >> prop2: y,
> >> arbirtraryProperties : {
> >>             someRandomProperty1:xxyyzz,
> >>             someRandomProperty2:xxyyzz,
> >>             someRandomProperty3:xxyyzz
> >> }
> >>
> >> Does this sound like a reasonable use case? We are on a tight timeline
> >> and I'm currently on the fence about getting something up and running
> >> like this on a tight timeline.
> >>
> >> Thanks,
> >> -Kal
> >
>

Re: cassandra as session store

Posted by Kallin Nagelberg <ka...@gmail.com>.
Cool, maybe we can help each other out. I'm using multiple web-apps,
all running in Resin containers. Have you thought about schema or how
to generate sessionIds for cookies?

-Kal

On Tue, Feb 1, 2011 at 12:22 PM, Sasha Dolgy <sd...@gmail.com> wrote:
> I am working on this tonight with jetty as front end and cassandra as
> backend session store.  Hopefully.
>
> On 1 Feb 2011 18:19, "Kallin Nagelberg" <ka...@gmail.com> wrote:
>> Hey,
>> I am currently investigating Cassandra for storing what are
>> effectively web sessions. Our production environment has about 10 high
>> end servers behind a load balancer, and we'd like to add distributed
>> session support. My main concerns are performance, consistency, and
>> the ability to create unique session keys. The last thing we would
>> want is users picking up each others sessions. After spending a few
>> days investigating Cassandra I'm thinking of creating a single
>> keyspace with a single super-column-family. The scf would store a few
>> standard columns, and a supercolumn of arbitrary session attributes,
>> like:
>>
>> 0s809sdf8s908sf90s: {
>> prop1: x,
>> created : timestamp,
>> lastAccessed: timestamp,
>> prop2: y,
>> arbirtraryProperties : {
>>             someRandomProperty1:xxyyzz,
>>             someRandomProperty2:xxyyzz,
>>             someRandomProperty3:xxyyzz
>> }
>>
>> Does this sound like a reasonable use case? We are on a tight timeline
>> and I'm currently on the fence about getting something up and running
>> like this on a tight timeline.
>>
>> Thanks,
>> -Kal
>

Re: cassandra as session store

Posted by Sasha Dolgy <sd...@gmail.com>.
I am working on this tonight with jetty as front end and cassandra as
backend session store.  Hopefully.
On 1 Feb 2011 18:19, "Kallin Nagelberg" <ka...@gmail.com> wrote:
> Hey,
> I am currently investigating Cassandra for storing what are
> effectively web sessions. Our production environment has about 10 high
> end servers behind a load balancer, and we'd like to add distributed
> session support. My main concerns are performance, consistency, and
> the ability to create unique session keys. The last thing we would
> want is users picking up each others sessions. After spending a few
> days investigating Cassandra I'm thinking of creating a single
> keyspace with a single super-column-family. The scf would store a few
> standard columns, and a supercolumn of arbitrary session attributes,
> like:
>
> 0s809sdf8s908sf90s: {
> prop1: x,
> created : timestamp,
> lastAccessed: timestamp,
> prop2: y,
> arbirtraryProperties : {
>             someRandomProperty1:xxyyzz,
>             someRandomProperty2:xxyyzz,
>             someRandomProperty3:xxyyzz
> }
>
> Does this sound like a reasonable use case? We are on a tight timeline
> and I'm currently on the fence about getting something up and running
> like this on a tight timeline.
>
> Thanks,
> -Kal

Re: cassandra as session store

Posted by Edward Capriolo <ed...@gmail.com>.
On Tue, Feb 1, 2011 at 12:57 PM, Anthony John <ch...@gmail.com> wrote:
> Not a concern - and here is why:-
> From the wiki arch section captioned below - eventual consistency does not
> have to mean inconsistent reads. The concern is the overhead for consistent
> reads. But remember in the use case being cited, the expensive read will
> happen only during failover, not all the time.
>
> More specifically: R=read replica count W=write replica count N=replication
> factor Q=QUORUM (Q = N / 2 + 1)
>
> If W + R > N, you will have consistency
>
> W=1, R=N
> W=N, R=1
> W=Q, R=Q where Q = N / 2 + 1
>
> On Tue, Feb 1, 2011 at 11:47 AM, Tong Zhu <To...@rms.com> wrote:
>>
>> The problem is where to store the session data. If the session need to be
>> accessible by more than one web servers, the external storage is needed.
>>
>> Cassandra only supports eventual consistency. If web server w1 saves the
>> session at node 1 of cassendra while web server w2 retrieve the session from
>> different node, if these two requests are close enough, there is a chance
>> what w2 retrieved is different from what w1 saved. Is it a concern?
>>
>> Tong
>>
>>
>>
>> -----Original Message-----
>> From: buddhasystem [mailto:potekhin@bnl.gov]
>> Sent: Tuesday, February 01, 2011 9:42 AM
>> To: cassandra-user@incubator.apache.org
>> Subject: Re: cassandra as session store
>>
>>
>> Most if not all modern web application frameworks support sessions. This
>> applies to Django (with which I have most experience and also run it with
>> X.509 security layer) but also to Ruby on Rails and Pylons.
>>
>> So, why would you re-invent the wheel? Too messy. It's all out there for
>> you
>> to use.
>>
>> Regards,
>> Maxim
>>
>> --
>> View this message in context:
>> http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/cassandra-as-session-store-tp5981871p5981961.html
>> Sent from the cassandra-user@incubator.apache.org mailing list archive at
>> Nabble.com.
>>
>>
>> This message and any attachments contain information that may be RMS Inc.
>> confidential and/or privileged.  If you are not the intended recipient (or
>> authorized to receive for the intended recipient), and have received this
>> message in error, any use, disclosure or distribution is strictly
>> prohibited.   If you have received this message in error, please notify the
>> sender immediately by replying to the e-mail and permanently deleting the
>> message from your computer and/or storage system.
>
>

Ah. Eventual Consistency! Mama no! RUN!

From:
Download JSR-000315 Java Servlet 3.0 Final Release for Documentation, English

Distributed Environments

Within an application marked as distributable, all requests that are
part of a session
must be handled by one JVM at a time. The container must be able to handle all
objects placed into instances of the HttpSession class using the setAttribute or
putValue methods appropriately. The following restrictions are imposed to meet
these conditions:

This look to be the responsibly of the web cluster to ensure
serialized access not the backend. (At least how I am reading it)

Re: cassandra as session store

Posted by Anthony John <ch...@gmail.com>.
Not a concern - and here is why:-

>From the wiki arch section captioned below - eventual consistency does not
have to mean inconsistent reads. The concern is the overhead for consistent
reads. But remember in the use case being cited, the expensive read will
happen only during failover, not all the time.

More specifically: R=read replica count W=write replica count N=replication
factor Q=*QUORUM* (Q = N / 2 + 1)

   -

   If W + R > N, you will have consistency
   - W=1, R=N
   - W=N, R=1
   - W=Q, R=Q where Q = N / 2 + 1


On Tue, Feb 1, 2011 at 11:47 AM, Tong Zhu <To...@rms.com> wrote:

> The problem is where to store the session data. If the session need to be
> accessible by more than one web servers, the external storage is needed.
>
> Cassandra only supports eventual consistency. If web server w1 saves the
> session at node 1 of cassendra while web server w2 retrieve the session from
> different node, if these two requests are close enough, there is a chance
> what w2 retrieved is different from what w1 saved. Is it a concern?
>
> Tong
>
>
>
> -----Original Message-----
> From: buddhasystem [mailto:potekhin@bnl.gov]
> Sent: Tuesday, February 01, 2011 9:42 AM
> To: cassandra-user@incubator.apache.org
> Subject: Re: cassandra as session store
>
>
> Most if not all modern web application frameworks support sessions. This
> applies to Django (with which I have most experience and also run it with
> X.509 security layer) but also to Ruby on Rails and Pylons.
>
> So, why would you re-invent the wheel? Too messy. It's all out there for
> you
> to use.
>
> Regards,
> Maxim
>
> --
> View this message in context:
> http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/cassandra-as-session-store-tp5981871p5981961.html
> Sent from the cassandra-user@incubator.apache.org mailing list archive at
> Nabble.com.
>
>
> This message and any attachments contain information that may be RMS Inc.
> confidential and/or privileged.  If you are not the intended recipient (or
> authorized to receive for the intended recipient), and have received this
> message in error, any use, disclosure or distribution is strictly
> prohibited.   If you have received this message in error, please notify the
> sender immediately by replying to the e-mail and permanently deleting the
> message from your computer and/or storage system.
>

RE: cassandra as session store

Posted by Tong Zhu <To...@rms.com>.
The problem is where to store the session data. If the session need to be accessible by more than one web servers, the external storage is needed.

Cassandra only supports eventual consistency. If web server w1 saves the session at node 1 of cassendra while web server w2 retrieve the session from different node, if these two requests are close enough, there is a chance what w2 retrieved is different from what w1 saved. Is it a concern?

Tong



-----Original Message-----
From: buddhasystem [mailto:potekhin@bnl.gov]
Sent: Tuesday, February 01, 2011 9:42 AM
To: cassandra-user@incubator.apache.org
Subject: Re: cassandra as session store


Most if not all modern web application frameworks support sessions. This
applies to Django (with which I have most experience and also run it with
X.509 security layer) but also to Ruby on Rails and Pylons.

So, why would you re-invent the wheel? Too messy. It's all out there for you
to use.

Regards,
Maxim

--
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/cassandra-as-session-store-tp5981871p5981961.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.


This message and any attachments contain information that may be RMS Inc. confidential and/or privileged.  If you are not the intended recipient (or authorized to receive for the intended recipient), and have received this message in error, any use, disclosure or distribution is strictly prohibited.   If you have received this message in error, please notify the sender immediately by replying to the e-mail and permanently deleting the message from your computer and/or storage system.

Re: cassandra as session store

Posted by Sasha Dolgy <sd...@gmail.com>.
In my scenario all i need is simple session management.  That's all.  Quick
and useful for what i need.  Why i'm creating a wheel...
On 1 Feb 2011 18:42, "buddhasystem" <po...@bnl.gov> wrote:
>
> Most if not all modern web application frameworks support sessions. This
> applies to Django (with which I have most experience and also run it with
> X.509 security layer) but also to Ruby on Rails and Pylons.
>
> So, why would you re-invent the wheel? Too messy. It's all out there for
you
> to use.
>
> Regards,
> Maxim
>
> --
> View this message in context:
http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/cassandra-as-session-store-tp5981871p5981961.html
> Sent from the cassandra-user@incubator.apache.org mailing list archive at
Nabble.com.

Re: cassandra as session store

Posted by David <da...@silveregg.co.jp>.
Hi Joe,

On 02/02/2011 02:58 AM, Joe Stump wrote:
> FWIW we used Memcached for session data at Digg without any major issues. The one thing we did end up doing to reduce the LRU on sessions was to modify the slab size and put sessions in their own Memcached cluster. Probably not an issue for you though.

When you say you use memcached for session, do you mean you use it as 
your cache layer, or are you using it exclusively ?

thanks,

David

Re: cassandra as session store

Posted by Joe Stump <jo...@joestump.net>.
FWIW we used Memcached for session data at Digg without any major issues. The one thing we did end up doing to reduce the LRU on sessions was to modify the slab size and put sessions in their own Memcached cluster. Probably not an issue for you though.

+1 on Memcached.


On Feb 1, 2011, at 9:57 AM, buddhasystem wrote:

> 
> For completeness:
> 
> http://stackoverflow.com/questions/3746685/running-django-site-in-multiserver-environment-how-to-handle-sessions
> http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-sessions
> 
> I guess your approach does make sense, one only wishes that the servlet in
> question did more work for you. If I read correctly, Django can cache
> sessions transparently in memcached. So memcached mecomes your Session
> Management System. Is it better or worse than Cassandra? My feeling is that
> it's probably faster and easier to set up.
> 
> 
> -- 
> View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/cassandra-as-session-store-tp5981871p5982024.html
> Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.


Re: cassandra as session store

Posted by William R Speirs <bi...@gmail.com>.
I'm still very new to Cassandra, but when I started reading about it the first 
thing I thought about was a session store. It's based (in part from what I 
understand) on Dynamo which is (again, I could be wrong) used at Amazon as the 
session store for your shopping cart.

So I would certainly reach for Cassandra if I needed a reliable distributed 
session store.

Bill-

On 02/01/2011 03:24 PM, Sasha Dolgy wrote:
>
> What I'm still unclear about, and where I think this is suitable, is Cassandra
> being used as a data warehouse for current and past sessions tied to a user.
>   Yes, other things are great for session management, but I want to provide near
> real time session information to my users ... quick and simple and i want to use
> cassandra ... surely i can't be that bad for thinking this is a good idea?
> -sd
>
> On Tue, Feb 1, 2011 at 9:20 PM, Kallin Nagelberg <kallin.nagelberg@gmail.com
> <ma...@gmail.com>> wrote:
>
>     nvm on the persistence, it seems like it does support it:
>
>     'Since version 1.1 the safer alternative is an append-only file (a
>     journal) that is written as operations modifying the dataset in memory
>     are processed. Redis is able to rewrite the append-only file in the
>     background in order to avoid an indefinite growth of the journal.'
>
>     This thread probably shouldn't digress too much from Cassandra's
>     suitability for session management though..
>

Re: cassandra as session store

Posted by Janne Jalkanen <Ja...@ecyrd.com>.
If your sessions are fairly long-lived (more like hours instead of minutes) and you crank up a suitable row cache and make sure your db is consistent (via quorum read/writes or write:all, read:1) - sure, why not?  Especially if you're already familiar with Cassandra; possibly even have a deployed instance already for your web app. Adding new components to the mix is always a sure way to get some headscratching going. For a small team who does not want to spend too much time on configuring yet another database, Cassandra would probably work well as a session store. And you would get cross-datacenter reliability too.

However, you might want to use 0.7 and expiring columns; otherwise cleaning up is going to be boring.

/Janne

On Feb 1, 2011, at 22:24 , Sasha Dolgy wrote:

> 
> What I'm still unclear about, and where I think this is suitable, is Cassandra being used as a data warehouse for current and past sessions tied to a user.  Yes, other things are great for session management, but I want to provide near real time session information to my users ... quick and simple and i want to use cassandra ... surely i can't be that bad for thinking this is a good idea?
>   
> -sd
> 
> On Tue, Feb 1, 2011 at 9:20 PM, Kallin Nagelberg <ka...@gmail.com> wrote:
> nvm on the persistence, it seems like it does support it:
> 
> 'Since version 1.1 the safer alternative is an append-only file (a
> journal) that is written as operations modifying the dataset in memory
> are processed. Redis is able to rewrite the append-only file in the
> background in order to avoid an indefinite growth of the journal.'
> 
> This thread probably shouldn't digress too much from Cassandra's
> suitability for session management though..


Re: cassandra as session store

Posted by Sasha Dolgy <sd...@gmail.com>.
What I'm still unclear about, and where I think this is suitable, is
Cassandra being used as a data warehouse for current and past sessions tied
to a user.  Yes, other things are great for session management, but I want
to provide near real time session information to my users ... quick and
simple and i want to use cassandra ... surely i can't be that bad for
thinking this is a good idea?

-sd

On Tue, Feb 1, 2011 at 9:20 PM, Kallin Nagelberg <kallin.nagelberg@gmail.com
> wrote:

> nvm on the persistence, it seems like it does support it:
>
> 'Since version 1.1 the safer alternative is an append-only file (a
> journal) that is written as operations modifying the dataset in memory
> are processed. Redis is able to rewrite the append-only file in the
> background in order to avoid an indefinite growth of the journal.'
>
> This thread probably shouldn't digress too much from Cassandra's
> suitability for session management though..

Re: cassandra as session store

Posted by Kallin Nagelberg <ka...@gmail.com>.
nvm on the persistence, it seems like it does support it:

'Since version 1.1 the safer alternative is an append-only file (a
journal) that is written as operations modifying the dataset in memory
are processed. Redis is able to rewrite the append-only file in the
background in order to avoid an indefinite growth of the journal.'

This thread probably shouldn't digress too much from Cassandra's
suitability for session management though..

On Tue, Feb 1, 2011 at 3:10 PM, Kallin Nagelberg
<ka...@gmail.com> wrote:
> Reddis seems neat, but a couple issues:
>
> - It's 'persistence' is more of a timed backup. You are not guaranteed
> the latest results on disk.
> - no real 'clustering'. It has a master/slave system.
>
> Hard to say if those are deal breakers at this point, but the API for
> it seems nice.
>
> On Tue, Feb 1, 2011 at 1:48 PM, Kallin Nagelberg
> <ka...@gmail.com> wrote:
>> Hmm, looking at redis now. The built in time to live functionality
>> would be nice to have..
>>
>> On Tue, Feb 1, 2011 at 1:34 PM, Colin Vipurs <zo...@gmail.com> wrote:
>>> Wouldn't something like Redis be a better fit than Cassandra?
>>>
>>> On Tue, Feb 1, 2011 at 6:16 PM, Tong Zhu <To...@rms.com> wrote:
>>>> If it is a really session data, which will be active for a short time, a few hours, and it is OK to lose them, memcached is a better solution. I were using it when I was in Yahoo.
>>>>
>>>> Tong
>>>>
>>>> -----Original Message-----
>>>> From: buddhasystem [mailto:potekhin@bnl.gov]
>>>> Sent: Tuesday, February 01, 2011 9:57 AM
>>>> To: cassandra-user@incubator.apache.org
>>>> Subject: Re: cassandra as session store
>>>>
>>>>
>>>> For completeness:
>>>>
>>>> http://stackoverflow.com/questions/3746685/running-django-site-in-multiserver-environment-how-to-handle-sessions
>>>> http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-sessions
>>>>
>>>> I guess your approach does make sense, one only wishes that the servlet in
>>>> question did more work for you. If I read correctly, Django can cache
>>>> sessions transparently in memcached. So memcached mecomes your Session
>>>> Management System. Is it better or worse than Cassandra? My feeling is that
>>>> it's probably faster and easier to set up.
>>>>
>>>>
>>>> --
>>>> View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/cassandra-as-session-store-tp5981871p5982024.html
>>>> Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.
>>>>
>>>>
>>>> This message and any attachments contain information that may be RMS Inc. confidential and/or privileged.  If you are not the intended recipient (or authorized to receive for the intended recipient), and have received this message in error, any use, disclosure or distribution is strictly prohibited.   If you have received this message in error, please notify the sender immediately by replying to the e-mail and permanently deleting the message from your computer and/or storage system.
>>>>
>>>
>>>
>>>
>>> --
>>> Maybe she awoke to see the roommate's boyfriend swinging from the
>>> chandelier wearing a boar's head.
>>>
>>> Something which you, I, and everyone else would call "Tuesday", of course.
>>>
>>
>

Re: cassandra as session store

Posted by Kallin Nagelberg <ka...@gmail.com>.
Reddis seems neat, but a couple issues:

- It's 'persistence' is more of a timed backup. You are not guaranteed
the latest results on disk.
- no real 'clustering'. It has a master/slave system.

Hard to say if those are deal breakers at this point, but the API for
it seems nice.

On Tue, Feb 1, 2011 at 1:48 PM, Kallin Nagelberg
<ka...@gmail.com> wrote:
> Hmm, looking at redis now. The built in time to live functionality
> would be nice to have..
>
> On Tue, Feb 1, 2011 at 1:34 PM, Colin Vipurs <zo...@gmail.com> wrote:
>> Wouldn't something like Redis be a better fit than Cassandra?
>>
>> On Tue, Feb 1, 2011 at 6:16 PM, Tong Zhu <To...@rms.com> wrote:
>>> If it is a really session data, which will be active for a short time, a few hours, and it is OK to lose them, memcached is a better solution. I were using it when I was in Yahoo.
>>>
>>> Tong
>>>
>>> -----Original Message-----
>>> From: buddhasystem [mailto:potekhin@bnl.gov]
>>> Sent: Tuesday, February 01, 2011 9:57 AM
>>> To: cassandra-user@incubator.apache.org
>>> Subject: Re: cassandra as session store
>>>
>>>
>>> For completeness:
>>>
>>> http://stackoverflow.com/questions/3746685/running-django-site-in-multiserver-environment-how-to-handle-sessions
>>> http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-sessions
>>>
>>> I guess your approach does make sense, one only wishes that the servlet in
>>> question did more work for you. If I read correctly, Django can cache
>>> sessions transparently in memcached. So memcached mecomes your Session
>>> Management System. Is it better or worse than Cassandra? My feeling is that
>>> it's probably faster and easier to set up.
>>>
>>>
>>> --
>>> View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/cassandra-as-session-store-tp5981871p5982024.html
>>> Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.
>>>
>>>
>>> This message and any attachments contain information that may be RMS Inc. confidential and/or privileged.  If you are not the intended recipient (or authorized to receive for the intended recipient), and have received this message in error, any use, disclosure or distribution is strictly prohibited.   If you have received this message in error, please notify the sender immediately by replying to the e-mail and permanently deleting the message from your computer and/or storage system.
>>>
>>
>>
>>
>> --
>> Maybe she awoke to see the roommate's boyfriend swinging from the
>> chandelier wearing a boar's head.
>>
>> Something which you, I, and everyone else would call "Tuesday", of course.
>>
>

Re: cassandra as session store

Posted by Kallin Nagelberg <ka...@gmail.com>.
Hmm, looking at redis now. The built in time to live functionality
would be nice to have..

On Tue, Feb 1, 2011 at 1:34 PM, Colin Vipurs <zo...@gmail.com> wrote:
> Wouldn't something like Redis be a better fit than Cassandra?
>
> On Tue, Feb 1, 2011 at 6:16 PM, Tong Zhu <To...@rms.com> wrote:
>> If it is a really session data, which will be active for a short time, a few hours, and it is OK to lose them, memcached is a better solution. I were using it when I was in Yahoo.
>>
>> Tong
>>
>> -----Original Message-----
>> From: buddhasystem [mailto:potekhin@bnl.gov]
>> Sent: Tuesday, February 01, 2011 9:57 AM
>> To: cassandra-user@incubator.apache.org
>> Subject: Re: cassandra as session store
>>
>>
>> For completeness:
>>
>> http://stackoverflow.com/questions/3746685/running-django-site-in-multiserver-environment-how-to-handle-sessions
>> http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-sessions
>>
>> I guess your approach does make sense, one only wishes that the servlet in
>> question did more work for you. If I read correctly, Django can cache
>> sessions transparently in memcached. So memcached mecomes your Session
>> Management System. Is it better or worse than Cassandra? My feeling is that
>> it's probably faster and easier to set up.
>>
>>
>> --
>> View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/cassandra-as-session-store-tp5981871p5982024.html
>> Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.
>>
>>
>> This message and any attachments contain information that may be RMS Inc. confidential and/or privileged.  If you are not the intended recipient (or authorized to receive for the intended recipient), and have received this message in error, any use, disclosure or distribution is strictly prohibited.   If you have received this message in error, please notify the sender immediately by replying to the e-mail and permanently deleting the message from your computer and/or storage system.
>>
>
>
>
> --
> Maybe she awoke to see the roommate's boyfriend swinging from the
> chandelier wearing a boar's head.
>
> Something which you, I, and everyone else would call "Tuesday", of course.
>

Re: cassandra as session store

Posted by Colin Vipurs <zo...@gmail.com>.
Wouldn't something like Redis be a better fit than Cassandra?

On Tue, Feb 1, 2011 at 6:16 PM, Tong Zhu <To...@rms.com> wrote:
> If it is a really session data, which will be active for a short time, a few hours, and it is OK to lose them, memcached is a better solution. I were using it when I was in Yahoo.
>
> Tong
>
> -----Original Message-----
> From: buddhasystem [mailto:potekhin@bnl.gov]
> Sent: Tuesday, February 01, 2011 9:57 AM
> To: cassandra-user@incubator.apache.org
> Subject: Re: cassandra as session store
>
>
> For completeness:
>
> http://stackoverflow.com/questions/3746685/running-django-site-in-multiserver-environment-how-to-handle-sessions
> http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-sessions
>
> I guess your approach does make sense, one only wishes that the servlet in
> question did more work for you. If I read correctly, Django can cache
> sessions transparently in memcached. So memcached mecomes your Session
> Management System. Is it better or worse than Cassandra? My feeling is that
> it's probably faster and easier to set up.
>
>
> --
> View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/cassandra-as-session-store-tp5981871p5982024.html
> Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.
>
>
> This message and any attachments contain information that may be RMS Inc. confidential and/or privileged.  If you are not the intended recipient (or authorized to receive for the intended recipient), and have received this message in error, any use, disclosure or distribution is strictly prohibited.   If you have received this message in error, please notify the sender immediately by replying to the e-mail and permanently deleting the message from your computer and/or storage system.
>



-- 
Maybe she awoke to see the roommate's boyfriend swinging from the
chandelier wearing a boar's head.

Something which you, I, and everyone else would call "Tuesday", of course.

RE: cassandra as session store

Posted by Tong Zhu <To...@rms.com>.
If it is a really session data, which will be active for a short time, a few hours, and it is OK to lose them, memcached is a better solution. I were using it when I was in Yahoo.

Tong

-----Original Message-----
From: buddhasystem [mailto:potekhin@bnl.gov]
Sent: Tuesday, February 01, 2011 9:57 AM
To: cassandra-user@incubator.apache.org
Subject: Re: cassandra as session store


For completeness:

http://stackoverflow.com/questions/3746685/running-django-site-in-multiserver-environment-how-to-handle-sessions
http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-sessions

I guess your approach does make sense, one only wishes that the servlet in
question did more work for you. If I read correctly, Django can cache
sessions transparently in memcached. So memcached mecomes your Session
Management System. Is it better or worse than Cassandra? My feeling is that
it's probably faster and easier to set up.


--
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/cassandra-as-session-store-tp5981871p5982024.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.


This message and any attachments contain information that may be RMS Inc. confidential and/or privileged.  If you are not the intended recipient (or authorized to receive for the intended recipient), and have received this message in error, any use, disclosure or distribution is strictly prohibited.   If you have received this message in error, please notify the sender immediately by replying to the e-mail and permanently deleting the message from your computer and/or storage system.

Re: cassandra as session store

Posted by buddhasystem <po...@bnl.gov>.
For completeness:

http://stackoverflow.com/questions/3746685/running-django-site-in-multiserver-environment-how-to-handle-sessions
http://docs.djangoproject.com/en/dev/topics/http/sessions/#using-cached-sessions

I guess your approach does make sense, one only wishes that the servlet in
question did more work for you. If I read correctly, Django can cache
sessions transparently in memcached. So memcached mecomes your Session
Management System. Is it better or worse than Cassandra? My feeling is that
it's probably faster and easier to set up.


-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/cassandra-as-session-store-tp5981871p5982024.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.

Re: cassandra as session store

Posted by Kallin Nagelberg <ka...@gmail.com>.
We're using servlets which also support sessions, but you have to rely
on the servlet container to offer any sort of distributed session
handling and this produces scalability issues past a certain point.
Same thing for persistent sessions (survive restart). We also want a
mechanism that can operate for multiple types of clients, not
necessarily all the same type of web server.

One Session Management System to rule them all,
One Session Management System to find them,
One Session Management System to bring them all
and in the darkness bind them.

-Kal

On Tue, Feb 1, 2011 at 12:42 PM, buddhasystem <po...@bnl.gov> wrote:
>
> Most if not all modern web application frameworks support sessions. This
> applies to Django (with which I have most experience and also run it with
> X.509 security layer) but also to Ruby on Rails and Pylons.
>
> So, why would you re-invent the wheel? Too messy. It's all out there for you
> to use.
>
> Regards,
> Maxim
>
> --
> View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/cassandra-as-session-store-tp5981871p5981961.html
> Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.
>

Re: cassandra as session store

Posted by buddhasystem <po...@bnl.gov>.
Most if not all modern web application frameworks support sessions. This
applies to Django (with which I have most experience and also run it with
X.509 security layer) but also to Ruby on Rails and Pylons.

So, why would you re-invent the wheel? Too messy. It's all out there for you
to use.

Regards,
Maxim

-- 
View this message in context: http://cassandra-user-incubator-apache-org.3065146.n2.nabble.com/cassandra-as-session-store-tp5981871p5981961.html
Sent from the cassandra-user@incubator.apache.org mailing list archive at Nabble.com.