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 4417C18EF0 for ; Tue, 1 Mar 2016 17:59:53 +0000 (UTC) Received: (qmail 93927 invoked by uid 500); 1 Mar 2016 17:59:47 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 93852 invoked by uid 500); 1 Mar 2016 17:59:47 -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 93791 invoked by uid 99); 1 Mar 2016 17:59:47 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 01 Mar 2016 17:59:47 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 4151EC3765 for ; Tue, 1 Mar 2016 17:59:47 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 1.179 X-Spam-Level: * X-Spam-Status: No, score=1.179 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx2-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 6Iwm1SuSdKoZ for ; Tue, 1 Mar 2016 17:59:45 +0000 (UTC) Received: from mail-ig0-f179.google.com (mail-ig0-f179.google.com [209.85.213.179]) by mx2-lw-us.apache.org (ASF Mail Server at mx2-lw-us.apache.org) with ESMTPS id 70F3960E34 for ; Tue, 1 Mar 2016 17:42:43 +0000 (UTC) Received: by mail-ig0-f179.google.com with SMTP id hb3so23319758igb.0 for ; Tue, 01 Mar 2016 09:42:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to; bh=/f2HvP9scpniTkIk3UXw3Gmu2HTYUe3PZ9jlJMOrB/Q=; b=sd/hZvfbo98eZTwGr1Zs6RItClLG57YARHcx/8L4AVizhiRVnJDxnMMKApU2Bb00ri tCusrZ19QYNgUf481R9YdGRaGXU9UwsAzNqtItxa0VKR9N8Ic7iM/ckEKshTcSEz9ePB yQ+YN9BdLEogKd6RQ0RxOf9Mzck61Lvq8Pe4oRsOOSEAR71IMX9aZB5ZuQLi+E4EGlpj FTzK1eL/aDnehy1C0H0PFeZnG3DfzdXMaiXfN5nhW9E6eq94mwTP7Mnsgyy4Qi4Fu/FF f9rKoeEX3oX949mqRYZDzac44A0wSinng/zE0emOMQc0hhWeVtLX3yQ4BsnnE7xUWhgq 0BLQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to; bh=/f2HvP9scpniTkIk3UXw3Gmu2HTYUe3PZ9jlJMOrB/Q=; b=jcPoB1Ro99FBHxhlcD1rovfcyjlQqmwcBq+6EGs0fKJw1+HdaDLf6e5pT7P4Vxl2qK pytJAB7DmJDLtRAvl8nC5z62D3BIOy4ppjEXMXKtPlmiOa8gynoguf7UiARr4r43if37 ucWPbbUmI4Ol6XgGcO3TBicC8qChmnQ7ylmJZU/Y8GyaFkXY3KPkRmZe6Gn1MYlQkhEo R8PIQboTYoPtgU9oTAODKWHaSl6s8B10jXqBY+BXHr+Bl4Xp35xxi39gqAJNOBjy3mWD /gJw28YWmKqdEcfCRWoptQv/jA/FYJs3SsrgKjEzfx+ZwOg8Q2ORsTNs8XhFq2GGM/Oz itiw== X-Gm-Message-State: AD7BkJJa83Zw5lmmBmUGqEOM7eav9elOCROmVOyAUQHEXk9xX2lFCIfO5MzhLp55Mf7aDbRIIyZqG8dOVfTx6Q== MIME-Version: 1.0 X-Received: by 10.50.117.103 with SMTP id kd7mr231121igb.57.1456853978946; Tue, 01 Mar 2016 09:39:38 -0800 (PST) Received: by 10.107.145.69 with HTTP; Tue, 1 Mar 2016 09:39:38 -0800 (PST) In-Reply-To: References: Date: Tue, 1 Mar 2016 11:39:38 -0600 Message-ID: Subject: Re: List of List From: Sandeep Kalra To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=089e013a084ce7a537052d003f5f --089e013a084ce7a537052d003f5f Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable =E2=80=8BI do not have limit of number of Answers or its comments.=E2=80=8B= Assume it to be clone of StackOverflow.. Best Regards, Sandeep Kalra On Tue, Mar 1, 2016 at 11:29 AM, Jack Krupansky wrote: > Clustering columns are your friends. > > But the first question is how you need to query the data. Queries drive > data models in Cassandra. > > What is the cardinality of this data - how many answers per question and > how many comments per answer? > > > -- Jack Krupansky > > On Tue, Mar 1, 2016 at 12:23 PM, Sandeep Kalra > wrote: > >> Hi all. >> >> I am beginner in Cassandra. >> >> I am working on Q&A project where I have to maintain a list of list for >> objects. >> >> For e.g. A Question can have list of Answers, and each Answer can then >> have list of Comments. >> >> -- >> As of now I have 3 tables. Questions, Answers, and Comments. I have >> stored UID of Answers in List for question, and then eac= h >> answer has List in separate table. [Optionally a Commen= t >> may have replies] >> >> I do multiple queries to find the complete answers-list and then its >> related comments. >> >> This whole thing looks inefficient to me. >> -- >> >> Question: >> *Is there a better way to do it in Cassandra*. What can I do as far as >> re-designing database to have lesser queries. >> >> >> >> Best Regards, >> Sandeep Kalra >> >> > --089e013a084ce7a537052d003f5f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
=E2=80=8BI do not have limit of number of Answers or its comments.=E2=80= =8B Assume it to be clone of StackOverflow..



Best Regards,
Sand= eep Kalra


On Tue, Mar 1, 2016 at 11:29 AM, Jack Krupan= sky <jack.krupansky@gmail.com> wrote:
Clustering columns are your friends.
But the first question is how you need to query the data. = Queries drive data models in Cassandra.

What is th= e cardinality of this data - how many answers per question and how many com= ments per answer?


-- Jack Krupansky

On Tue, Mar 1, 2016 at 12:23 PM, Sandeep Kal= ra <sandeep.kalra@gmail.com> wrote:
Hi all.

I am begi= nner in Cassandra.=C2=A0

I am= working on Q&A project where I have to maintain a list of list for obj= ects.

<= div class=3D"gmail_default" style=3D"color:#330099">For e.g. A Question can= have list of Answers, and each Answer can then have list of Comments.

--
= As of now I have 3 tables. Questions, Answers, and Comments. I have stored = UID of Answers in List<uid of answers> for question, and then each an= swer has List<UID of comments> in separate table. [Optionally a Comme= nt may have replies]

I do mul= tiple queries to find the complete answers-list and then its related commen= ts.=C2=A0

This whole thing lo= oks inefficient to me.
--=C2=A0

Question:
Is there a better way to do it in Cassandra. What can I do = as far as re-designing database to have lesser queries.



<= font face=3D"georgia, serif">Best Regards,
Sandeep Kalra
=


--089e013a084ce7a537052d003f5f--