Return-Path: Delivered-To: apmail-incubator-cassandra-user-archive@minotaur.apache.org Received: (qmail 52611 invoked from network); 15 Sep 2009 16:27:14 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 15 Sep 2009 16:27:14 -0000 Received: (qmail 53595 invoked by uid 500); 15 Sep 2009 16:27:13 -0000 Delivered-To: apmail-incubator-cassandra-user-archive@incubator.apache.org Received: (qmail 53579 invoked by uid 500); 15 Sep 2009 16:27:13 -0000 Mailing-List: contact cassandra-user-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: cassandra-user@incubator.apache.org Delivered-To: mailing list cassandra-user@incubator.apache.org Received: (qmail 53570 invoked by uid 99); 15 Sep 2009 16:27:13 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Sep 2009 16:27:13 +0000 X-ASF-Spam-Status: No, hits=1.2 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of goffinet@digg.com designates 64.191.203.36 as permitted sender) Received: from [64.191.203.36] (HELO mail.digg.com) (64.191.203.36) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 15 Sep 2009 16:27:02 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.digg.com (Postfix) with ESMTP id B4CE0A84FC6 for ; Tue, 15 Sep 2009 09:26:11 -0700 (PDT) X-Virus-Scanned: amavisd-new at d242.digg.internal Received: from mail.digg.com ([127.0.0.1]) by localhost (mail.digg.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id KaPyRuIXaXGp for ; Tue, 15 Sep 2009 09:26:11 -0700 (PDT) Received: from [10.2.16.222] (diggstage01.digg.com [64.191.203.34]) by mail.digg.com (Postfix) with ESMTP id 31A54A84FC8 for ; Tue, 15 Sep 2009 09:26:11 -0700 (PDT) From: Chris Goffinet Mime-Version: 1.0 (Apple Message framework v1076) Content-Type: multipart/alternative; boundary=Apple-Mail-1--153135867 Subject: Re: random n00b question Date: Tue, 15 Sep 2009 09:26:10 -0700 In-Reply-To: To: cassandra-user@incubator.apache.org References: <4AAE1581.90309@boboco.ie> <7bfc6c610909141609k20f402c7o4419428916e8a642@mail.gmail.com> <7bfc6c610909141623k382b8302g1c6c9c9a8f9bfc2a@mail.gmail.com> <4AAF6CCA.3030205@boboco.ie> Message-Id: X-Mailer: Apple Mail (2.1076) X-Virus-Checked: Checked by ClamAV on apache.org --Apple-Mail-1--153135867 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes On Sep 15, 2009, at 8:09 AM, Mark Robson wrote: > > > 2009/9/15 Jonathan Ellis > We don't currently have any optimizations to provide "lightweight" > session consistency (see #132), but if you do quorum reads + quorum > writes then you are guaranteed to read the most recent write which > should be fine for most apps. > > Quorum read / write would be required, yes. > > But the typical model used by web page session handlers also > requires locking, otherwise you can lose data by concurrent updates. > Do you really expect a user to open up multiple tabs and start clicking concurrently? Is the use case for bots? Remember, if you're trying to capture a user's activity and think they might open up many windows, I wouldn't be saving that into a session in general. > Consider the read / modify / write scenario typically used, a > traditional database might do: > > BEGIN TRANSACTION; > SELECT sessiondata FROM sessions WHERE id='my session id' FOR UPDATE; > ... with session in place, execute the page code, modifying > sessiondata in memory > UPDATE sessions SET sessiondata='modified session data' WHERE id='my > session id'; > COMMIT; > That's doable. But in best practice, just a very bad idea. You're adding overhead to what your trying to accomplish. If you're sticking all your data into the session, that might just be a bad idea in general. I worked at company where the previous programmer tried to get very clever, and add memcache locks for sessions. Cleverness is almost always a _bad_ idea. > Cassandra has no way to emulate this behaviour, therefore > functionality would be lost if you moved from a traditional database > session handler to Cassandra. > > Even using quorum reads and writes, if a user in the same session > has two pages active at once, session data would be trashed. > > Mark --Apple-Mail-1--153135867 Content-Transfer-Encoding: 7bit Content-Type: text/html; charset=us-ascii
On Sep 15, 2009, at 8:09 AM, Mark Robson wrote:



2009/9/15 Jonathan Ellis <jbellis@gmail.com>
We don't currently have any optimizations to provide "lightweight"
session consistency (see #132), but if you do quorum reads + quorum
writes then you are guaranteed to read the most recent write which
should be fine for most apps.

Quorum read / write would be required, yes.

But the typical model used by web page session handlers also requires locking, otherwise you can lose data by concurrent updates.


Do you really expect a user to open up multiple tabs and start clicking concurrently? Is the use case for bots? Remember, if you're trying to capture a user's activity and think they might open up many windows, I wouldn't be saving that into a session in general. 

Consider the read / modify / write scenario typically used, a traditional database might do:

BEGIN TRANSACTION;
SELECT sessiondata FROM sessions WHERE id='my session id' FOR UPDATE;
... with session in place, execute the page code, modifying sessiondata in memory
UPDATE sessions SET sessiondata='modified session data' WHERE id='my session id';
COMMIT;


That's doable. But in best practice, just a very bad idea. You're adding overhead to what your trying to accomplish. If you're sticking all your data into the session, that might just be a bad idea in general. I worked at company where the previous programmer tried to get very clever, and add memcache locks for sessions. Cleverness is almost always a _bad_ idea.

Cassandra has no way to emulate this behaviour, therefore functionality would be lost if you moved from a traditional database session handler to Cassandra.

Even using quorum reads and writes, if a user in the same session has two pages active at once, session data would be trashed.

Mark

--Apple-Mail-1--153135867--