Return-Path: X-Original-To: apmail-cassandra-user-archive@www.apache.org Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 89266DE08 for ; Wed, 19 Sep 2012 12:46:43 +0000 (UTC) Received: (qmail 61626 invoked by uid 500); 19 Sep 2012 12:46:41 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 61341 invoked by uid 500); 19 Sep 2012 12:46:40 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 61291 invoked by uid 99); 19 Sep 2012 12:46:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2012 12:46:38 +0000 X-ASF-Spam-Status: No, hits=-2.3 required=5.0 tests=RCVD_IN_DNSWL_MED,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [192.174.58.134] (HELO XEDGEA.nrel.gov) (192.174.58.134) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 19 Sep 2012 12:46:31 +0000 Received: from XHUBA.nrel.gov (10.20.4.58) by XEDGEA.nrel.gov (192.174.58.134) with Microsoft SMTP Server (TLS) id 8.3.245.1; Wed, 19 Sep 2012 06:45:57 -0600 Received: from MAILBOX2.nrel.gov ([fe80::19a0:6c19:6421:12f]) by XHUBA.nrel.gov ([::1]) with mapi; Wed, 19 Sep 2012 06:46:09 -0600 From: "Hiller, Dean" To: "user@cassandra.apache.org" Date: Wed, 19 Sep 2012 06:46:07 -0600 Subject: Re: Data Model - Consistency question Thread-Topic: Data Model - Consistency question Thread-Index: Ac2WZL0w9lUyS3GvTUifL0xd6oOBPA== Message-ID: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: user-agent: Microsoft-MacOutlook/14.2.3.120616 acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Yes, this scenario can occur(even with quorum writes/reads as you are deali= ng with different rows) as one write may be complete and the other not whil= e someone else is reading from the cluster. Generally though, you can do r= ead repair when you read it in ;). Ie. See if things are inconsistent when= reading it and either 1. Wait and read again or 2. Figure out a way to dis= play the results correctly based on merging data. In general #1 on a lot o= f systems is not a bad approach when you can't merge the data yourself beca= use the conflicts are not happening to often(maybe < 1% of the time in a lo= t of cases) With playOrm if you have partitions, you can still have that relational mod= el you described if you can figure out a partition strategy AND you can the= n query on it with joins and such. Later, Dean From: Roshni Rajagopal > Reply-To: "user@cassandra.apache.org" > Date: Wednesday, September 19, 2012 6:16 AM To: "user@cassandra.apache.org" > Subject: Data Model - Consistency question Hi Folks, In the relational world, if I needed to model students, courses relationshi= p, I may have done a students -master table a course - master table a bridge table students-course which gives me the ids to students and the c= ourses they are taking. This can answer both 'which students take course A'= , as well as 'which courses are taken by student B' In the cassandra world, I may design it like this a static student column family a static course column family a student-course column family with student id as key and dynamic list of c= ourse - ids to answer 'which courses are taken by student B' a course-student column family with course id as key and dynamic list of st= udent ids 'which students take course A' A screen which displays some student entity details as well as all the cour= ses she is taking will need to refer to 2 column families Suppose an application inserts a new row in student column family, and a ne= w row in student-course column family, as transactions or consistency acros= s column families is not guaranteed, there is a chance that the client rece= ives information that a student is attending a course from student-course c= olumn family, but does not exist in the student column family. If we use Strong consistency from the reads + writes combination - will th= is scenario not occur ? And if we dont, can this scenario occur? Regards, Roshni Regards, Roshni