From cassandra-user-return-2986-apmail-incubator-cassandra-user-archive=incubator.apache.org@incubator.apache.org Sat Mar 06 21:50:58 2010 Return-Path: Delivered-To: apmail-incubator-cassandra-user-archive@minotaur.apache.org Received: (qmail 51414 invoked from network); 6 Mar 2010 21:50:58 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 6 Mar 2010 21:50:58 -0000 Received: (qmail 30395 invoked by uid 500); 6 Mar 2010 21:50:39 -0000 Delivered-To: apmail-incubator-cassandra-user-archive@incubator.apache.org Received: (qmail 30378 invoked by uid 500); 6 Mar 2010 21:50:39 -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 30370 invoked by uid 99); 6 Mar 2010 21:50:39 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Mar 2010 21:50:39 +0000 X-ASF-Spam-Status: No, hits=2.9 required=10.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_NONE,SPF_NEUTRAL X-Spam-Check-By: apache.org Received-SPF: neutral (athena.apache.org: local policy) Received: from [209.85.219.224] (HELO mail-ew0-f224.google.com) (209.85.219.224) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 06 Mar 2010 21:50:35 +0000 Received: by ewy24 with SMTP id 24so76389ewy.27 for ; Sat, 06 Mar 2010 13:50:13 -0800 (PST) MIME-Version: 1.0 Received: by 10.213.100.165 with SMTP id y37mr1688422ebn.71.1267912213304; Sat, 06 Mar 2010 13:50:13 -0800 (PST) In-Reply-To: <8211a1321003060213y4c5429e9v9672cca7ddb84a9a@mail.gmail.com> References: <1385a5191003060123x6950035ci815e852479d3e516@mail.gmail.com> <1267867906320-4685649.post@n2.nabble.com> <8211a1321003060213y4c5429e9v9672cca7ddb84a9a@mail.gmail.com> Date: Sat, 6 Mar 2010 13:50:13 -0800 Message-ID: <36e83ac61003061350k128d8171y12d1a01171a054c7@mail.gmail.com> Subject: Re: How to model hierarchical structure? From: Jean-Denis Greze To: cassandra-user@incubator.apache.org Content-Type: multipart/alternative; boundary=001636c5986f1497f8048128d121 --001636c5986f1497f8048128d121 Content-Type: text/plain; charset=ISO-8859-1 This really depends on the operations you want to optimize for. What's important to you? Aggregate queries? Finding children/siblings/ancestors? Reorganizing the tree/hierarchy? For Cassandra, you really need to spend time thinking about how you'll be accessing things and design for that. If it's a 2-3 level hierarchy, then straight forward approaches like what Jeff suggested seem logical. Otherwise, I'd say if you've got an arbitrary-level hierarchy, then you'll have to think about how to efficiently adapt one of the usual suspects for this stuff (adjacency lists, nested sets, materialized paths, etc.). I, for one, would be interested in knowing if anyone else's experienced with this kind of stuff in Cassandra. http://stackoverflow.com/questions/192220/what-is-the-most-efficient-elegant-way-to-parse-a-flat-table-into-a-tree/192462#192462 and the like might be good places to start. On Sat, Mar 6, 2010 at 2:13 AM, Jeff Zhang wrote: > use the parent as column family and the child as the column under the > column family if this is two-level. > And you can use the super-column if there are more than two-levels > > > > > > On Sat, Mar 6, 2010 at 1:31 AM, HubertChang wrote: > >> >> For examples, like tags, many parents to many children. >> -- >> View this message in context: >> http://n2.nabble.com/How-to-model-hierarchical-structure-tp4685633p4685649.html >> Sent from the cassandra-user@incubator.apache.org mailing list archive at >> Nabble.com. >> > > > > -- > Best Regards > > Jeff Zhang > -- jeandenis@6coders.com (917) 951-0636 This email and any files transmitted with it are confidential and intended solely for the use of the individual to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system. If you are not the intended recipient you are notified that disclosing, copying, distributing or taking any action in reliance on the contents of this information is strictly prohibited. --001636c5986f1497f8048128d121 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable This really depends on the operations you want to optimize for. =A0What'= ;s important to you? =A0Aggregate queries? =A0Finding children/siblings/anc= estors? =A0Reorganizing the tree/hierarchy?

For Cassandr= a, you really need to spend time thinking about how you'll be accessing= things and design for that.

If it's a 2-3 level hierarchy, then straight forwar= d approaches like what Jeff suggested seem logical.

Otherwise, I'd say if you've got an arbitrary-level hierarchy, th= en you'll have to think about how to efficiently adapt one of the usual= suspects for this stuff (adjacency lists, nested sets, materialized paths,= etc.). =A0I, for one, would be interested in knowing if anyone else's = experienced with this kind of stuff in Cassandra.

http://stackoverflow.com/questions/192220/what-is-the-most-effic= ient-elegant-way-to-parse-a-flat-table-into-a-tree/192462#192462=A0

and the like might be good places to start.
<= div>
On Sat, Mar 6, 2010 at 2:13 AM, Jeff Zha= ng <zjffdu@gmail.c= om> wrote:
use the parent as column family and the chi= ld as the column under the column family if this is two-level.
And you c= an use the super-column if there are more than two-levels



=A0

On Sat, Mar 6, 2010 at 1:31 AM, HubertChang <huixiu@gmail.com> wrote:

For examples, like tags, many parents to many children.
--
View this message in context: http://n2.= nabble.com/How-to-model-hierarchical-structure-tp4685633p4685649.html Sent from the cassandra-user@incubator.apache.org mailing list archive at= Nabble.com.



--
Best= Regards

Jeff Zhang



--
jeandenis@6coders.com
(917) 951-0636
This email and any files transmitted with it are confidential and intended= solely for the use of the individual to whom they are addressed. If you ha= ve received this email in error please notify the system manager. This mess= age contains confidential information and is intended only for the individu= al named. If you are not the named addressee you should not disseminate, di= stribute or copy this e-mail. Please notify the sender immediately by e-mai= l if you have received this e-mail by mistake and delete this e-mail from y= our system. If you are not the intended recipient you are notified that dis= closing, copying, distributing or taking any action in reliance on the cont= ents of this information is strictly prohibited.

--001636c5986f1497f8048128d121--