[Standards] One more pubsub question: Name space for Nodes/Items under a Collection Node

Ralph Meijer jabber.org at ralphm.ik.nu
Thu Jan 25 14:40:49 UTC 2007

On Thu, 2007-01-25 at 09:28 -0500, Nick Parker wrote:
> Ralph Meijer wrote:
> > On Thu, 2007-01-25 at 00:53 -0500, Nick Parker wrote:
> >   
> >> In a tree of PubSub nodes, is there a single universal namespace across 
> >> the entire server, or is it okay for two nodes to share the same ID if 
> >> they are stored under different collection nodes?
> >>
> >> Here's an example configuration of node IDs, do any of the combinations 
> >> lead to a collision?:
> >>
> >> Root Collection P
> >>   Node A
> >>   Sub-Collection X
> >>     Node A
> >>     Node B
> >>   Sub-Collection Y
> >>     Node B
> >>     Node C
> >>     Node D
> >> Root Collection Q
> >>   Node C
> >>   Sub-Collection X
> >>     Node D
> >>     
> >
> > This shouldn't lead to any problems. Basically collections let you
> > create a directed acyclic graph. The nodes you show with the same name
> > are the same nodes. Taking 'A' as an example, when it generates
> > notifications, subscribers to nodes P, X and A will get those
> > notifications.
> >
> > One thing to note is that we have only one 'root' node, which is the
> > node with the empty identifier. It contains all the 'real' nodes in the
> > service.
> >   
> What I mean is, if there are two nodes in different locations on the 
> tree which contain  the same ID, must they point to the same data, or 
> can you have two different unrelated nodes, in different locations of 
> the tree, which share the same ID?
> In other words, if you were trying to describe a filesystem, and you had 
> two directories which each held different files named "Readme.txt", 
> would it be safe to use "Readme.txt" as both of their IDs, or would each 
> file need an ID which is unique across the entire tree?
> It looked like you'd need to have unique IDs for every unique Node (for 
> easier addressing), but I wanted to make sure.

There is no concept of hierarchy in Node IDs. They are opaque. If some
service shows the relation between leaf nodes and collections encoded
into the Node IDs (e.g. by using '/' characters as some kind of
separator), then this is very implementation specific.

> >> This question would also apply to Items which are stored under different 
> >> Nodes but share the same IDs.
> >>     
> >
> > Item IDs are (only) unique to their node. Collections don't contain
> > items
> So different Items under different Nodes may use the same ID?
> If we were using Items to represent the revisions of our files, could 
> you have two different files (Nodes) which both contain revisions 
> (Items) with ID '0' (where each "revision" holds unique data, such as 
> the MD5 of that particular version of the file), or would we need to 
> have Item IDs which are unique across the server?

The former.



More information about the Standards mailing list