jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Node structure design question
Date Tue, 17 Apr 2007 11:51:25 GMT
Hi Phillip,

Phillip Rhodes wrote:
> I have an application (http://stitches.authsum.com) that is storing objects
> of different types into jackrabbit.
> 
> For example,  I have the following types of objects:  ImageGallery,
> ImageContent, BinaryContent, HtmlContent, TextileContent
> 
> Currently, my tree is in the format of: //Root/Object Type/Object name
> 
> Example Data: /Root/ImageGallery/Fun in the sun /Root/ImageGallery/Who knows 
> /Root/ImageContent/Sun.jpg /Root/ImageContent/horse.gif 
> /Root/BinaryContent/horse.pdf /Root/BinaryContent/people.pdf 
> /Root/HtmlContent/horse.html /Root/HtmlContent/people.html 
> /Root/TextileContent/horse.html /Root/TextileContent/people.html
> 
> My question in all this is that I need to implement a "findContentByName"
> method that will return the Node given by object name of the node.  While I
> could do an xpath query to find a Node by this name, I am concerned about
> performance with this type of xpath query.

such queries should be relatively cheap, because currently you can only search 
for an exact name match. matching the name with a pattern is currently not 
possible.

> 1) Is the xpath query translated to a lucene query behind the scenes?

yes, it is.

> 2) Would you recommend a different structure to store my content? Should I make
> a wide flat structure of all my content and store the type as an attribute?
> I read that it is better to do deep structures (rather than wide), but is
> this the best design?

I think this depends on how you will access your content. E.g. if you have end 
users that will access the content I would rather introduce some kind of folder 
nodes that allow them to structure the content in an intuitive way.

In general having too many children under a certain node (>10000) will influence 
performance when you add or remove child nodes. But as I mentioned above if you 
have users that interact with the content you wouldn't want to have that many 
child nodes anyway, but rather structure them in a hierarchy.

regards
  marcel

Mime
View raw message