[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cassandra-user
Subject:    Re:Re: How to store tree structure in Cassandra
From:       Brink <jqworld () 163 ! com>
Date:       2009-10-30 9:45:38
Message-ID: 101531.931341256895938762.JavaMail.coremail () bj163app117 ! 163 ! com
[Download RAW message or body]

[Attachment #2 (text/plain)]


I cannot get the tree structure storing detail design by clicking the following link. \
Could you show me by other ways? If storing the tree structure in Cassandra is not \
good solution, can we have a server and store it in the server's memory?  
Regards,
-Brink


ÔÚ2009-10-30£¬Vijay <vijay2win@gmail.com> дµÀ£º
earlier, I was working on something similar to that... Some one has done some work \
based on Hbase....  


try this: http://dev.day.com/discussion-groups/content/lists/jackrabbit-dev/2009-02/2009-02-19_Jackrabbit_on_Hadoop_Marcel_Reutegger.html
 similar thing can be done on cassandra, if you looking at replacing the persistence \
manager....


For remove instead of making it orphan you might want to remove it, unless you want \
to write a map reduce job.

Regards,
</VJ>





On Wed, Oct 28, 2009 at 12:35 AM, Mark Robson <markxr@gmail.com> wrote:



2009/10/28 Brink <jqworld@163.com>


Hi All,
 
For a DMS, I want to replace MySQL with Cassandra to store file/folder nodes. Current \
I use adjacency list model to stores nodes hierarchy. The shortage of the adjacency \
list model is the expensive traversal cost. While I want to navigate the entire \
workspace or folder in hierarchy, I have to execute multiple queries (for each sub \
folder). In addition, special care must be taken when deleting nodes because of the \
potential for orphaning an entire sub-tree in the process (delete a folder and all of \
its children may be orphaned). How to design to store files/folders'node as tree \
structure in Cassandra?

Can you not use the entire path as a key? That would enable a recursive directory \
scan to become a simple range scan (which is supported provided you use the \
OrderedPartitioner)

The downside is that if you want to scan the immediate children you get a lot of \
additional junk you have to discard.

Storing redundant information in Cassandra (or any such database) is not an unusual \
solution - if you want very high scalability as well as good performance in competing \
cases (e.g. store the same thing under several keys)

Mark


[Attachment #3 (text/html)]

<DIV><BR>I cannot get the tree structure storing detail design by clicking the \
following link. Could you show me by other ways? If storing the tree structure in \
Cassandra is not good solution, can we have a server and store it in the server's \
memory?</DIV> <DIV>&nbsp;</DIV>
<DIV>Regards,</DIV>
<DIV>-Brink<BR></DIV>
<DIV></DIV><BR>ÔÚ2009-10-30£¬Vijay &lt;vijay2win@gmail.com&gt; дµÀ£º<BR>
<BLOCKQUOTE id="isReplyContent" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; \
BORDER-LEFT: #ccc 1px solid">earlier, I was working on something similar to that... \
Some one has done some work based on Hbase....&nbsp; <DIV><BR></DIV>
<DIV>try this:&nbsp;<A \
href="http://dev.day.com/discussion-groups/content/lists/jackrabbit-dev/2009-02/2009-0 \
2-19_Jackrabbit_on_Hadoop_Marcel_Reutegger.html">http://dev.day.com/discussion-groups/ \
content/lists/jackrabbit-dev/2009-02/2009-02-19_Jackrabbit_on_Hadoop_Marcel_Reutegger.html</A></DIV>
 <DIV>similar thing can be done on cassandra, if you looking at replacing the \
persistence manager....</DIV> <DIV><BR></DIV>
<DIV>For remove instead of making it orphan you might want to remove it, unless you \
want to write a map reduce job.</DIV> <DIV><BR \
clear="all">Regards,<BR>&lt;/VJ&gt;<BR><BR><BR><BR><BR> <DIV class="gmail_quote">On \
Wed, Oct 28, 2009 at 12:35 AM, Mark Robson <SPAN dir="ltr">&lt;<A \
href="mailto:markxr@gmail.com">markxr@gmail.com</A>&gt;</SPAN> wrote:<BR> <BLOCKQUOTE \
class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: \
#ccc 1px solid"><BR><BR> <DIV class="gmail_quote">2009/10/28 Brink <SPAN \
dir="ltr">&lt;<A href="mailto:jqworld@163.com" \
target="_blank">jqworld@163.com</A>&gt;</SPAN> <DIV class="im"><BR>
<BLOCKQUOTE class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; \
BORDER-LEFT: rgb(204,204,204) 1px solid"> <DIV>Hi All,</DIV>
<DIV>&nbsp;</DIV>
<DIV>For a DMS, I want to replace MySQL with Cassandra to store file/folder nodes. \
Current I use adjacency list model to stores nodes hierarchy. The shortage of the \
adjacency list model is the expensive traversal cost. While I want to navigate the \
entire workspace or folder in hierarchy, I have to execute multiple queries (for each \
sub folder). In addition, special care must be taken when deleting nodes because of \
the potential for orphaning an entire sub-tree in the process (delete a folder and \
all of its children may be orphaned). How&nbsp;to design to&nbsp;store \
files/folders'node as tree structure in Cassandra?</DIV></BLOCKQUOTE></DIV> \
<DIV><BR>Can you not use the entire path as a key? That would enable a recursive \
directory scan to become a simple range scan (which is supported provided you use the \
OrderedPartitioner)<BR><BR>The downside is that if you want to scan the immediate \
children you get a lot of additional junk you have to discard.<BR><BR>Storing \
redundant information in Cassandra (or any such database) is not an unusual solution \
- if you want very high scalability as well as good performance in competing cases \
(e.g. store the same thing under several \
keys)<BR><BR>Mark<BR></DIV></DIV></BLOCKQUOTE></DIV><BR></DIV></BLOCKQUOTE><br><br><span \
title="neteasefooter"/><hr/> <a \
href="http://allyes.nie.163.com/main/adfclick?db=afanie&bid=1254,611,23&cid=145,4,1&sid=1351&show=ignore&url=http://tx2.163.com/fab.html">09ÄêÐ \
½ú3DÖ÷Á÷ÍøÓΡ¶ÌìÏ ·¡¡·£¬ÍøÒ×ÁùÄêÒÚ×Ê´òÔì</a> </span>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic