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 D4343DEC5 for ; Wed, 19 Sep 2012 13:04:18 +0000 (UTC) Received: (qmail 13548 invoked by uid 500); 19 Sep 2012 13:04:16 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 13461 invoked by uid 500); 19 Sep 2012 13:04:16 -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 13436 invoked by uid 99); 19 Sep 2012 13:04:15 -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 13:04:15 +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 13:04:09 +0000 Received: from XHUBB.nrel.gov (10.20.4.59) by XEDGEA.nrel.gov (192.174.58.134) with Microsoft SMTP Server (TLS) id 8.3.245.1; Wed, 19 Sep 2012 07:03:36 -0600 Received: from MAILBOX2.nrel.gov ([fe80::19a0:6c19:6421:12f]) by XHUBB.nrel.gov ([::1]) with mapi; Wed, 19 Sep 2012 07:03:47 -0600 From: "Hiller, Dean" To: "user@cassandra.apache.org" Date: Wed, 19 Sep 2012 07:03:45 -0600 Subject: Re: Data Model - Consistency question Thread-Topic: Data Model - Consistency question Thread-Index: Ac2WZzRFSiq6MSVnQyCxmK/OwVcqWg== 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 Thinking a little more on your issue, you can also do that in playroom as OneToMany is represented with a few columns in the owning table/entity unlike JPA and RDBMS. Ie. Student.java { List - These course primary keys are saved one per column in the student's row } Course.java { List - These students are saved one per column in the courses row } We sometimes do this with playOrm and don't even bother with the S-SQL it has which also means you don't need to worry about partitioning in that case. Later, Dean On 9/19/12 6:46 AM, "Hiller, Dean" wrote: >Yes, this scenario can occur(even with quorum writes/reads as you are >dealing with different rows) as one write may be complete and the other >not while someone else is reading from the cluster. Generally though, >you can do read 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 display the results correctly based on merging data. >In general #1 on a lot of systems is not a bad approach when you can't >merge the data yourself because the conflicts are not happening to >often(maybe < 1% of the time in a lot of cases) > >With playOrm if you have partitions, you can still have that relational >model you described if you can figure out a partition strategy AND you >can then 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 >relationship, 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 >courses 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 >course - ids to answer 'which courses are taken by student B' >a course-student column family with course id as key and dynamic list of >student ids 'which students take course A' > >A screen which displays some student entity details as well as all the >courses she is taking will need to refer to 2 column families > >Suppose an application inserts a new row in student column family, and a >new row in student-course column family, as transactions or consistency >across column families is not guaranteed, there is a chance that the >client receives information that a student is attending a course from >student-course column family, but does not exist in the student column >family. > >If we use Strong consistency from the reads + writes combination - will >this scenario not occur ? >And if we dont, can this scenario occur? > >Regards, >Roshni > > > > > > >Regards, >Roshni