[ 
https://issues.apache.org/jira/browse/JCR-2857?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12977893#action_12977893
 ] 

Jukka Zitting commented on JCR-2857:
------------------------------------

The UUIDs of referenceable nodes must be globally unique to avoid problems when 
moving content between repositories. It must be possible to export a 
referenceable node from repository A and import it to repository B without 
worrying about UUID conflicts. We should be careful not to break this 
constraint, not even when a user makes a configuration mistake!

One possible way to do this might be to generate a random UUID during startup 
and use that as the basis of an incremental sequence of identifiers. At the 
next startup a new random base UUID would get generated. I'm not sure what this 
approach would do to UUID collision statistics.

On the code side I'd rather leave the UUID generation strategy up to the 
persistence manager implementation as it'll be best equipped to know what 
identifier distribution will work best with the underlying storage mechanism. 
Thus instead of a repository-wide NodeIdFactory, I'd add a createNodeId() 
factory method to the PersistenceManager interface and wire our code to use 
that method whenever a new identifier is needed.

In the long run I agree with Michael about the need to keep UUIDs and storage 
locations as separate concepts. For example, we could look at turning the 
NodeId class into an opaque interface with no required relationship with the 
JCR UUIDs visible through the jcr:uuid property. Each persistence manager could 
then choose to store whatever information it likes in the NodeId instances it 
creates, and we could use separate UUID instances (or simply identifier 
strings) to track node references and for things like 
Session.getNodeByIdentifier().

> Support sequential (non-random) node ids
> ----------------------------------------
>
>                 Key: JCR-2857
>                 URL: https://issues.apache.org/jira/browse/JCR-2857
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Thomas Mueller
>            Assignee: Thomas Mueller
>         Attachments: jcr-2857.patch
>
>
> Currently, node ids are generated using a (cryptographically secure pseudo-) 
> random number generator. This has a many advantages (easy to implement, easy 
> to merge nodes from multiple repositories or cluster nodes), but is a 
> performance bottleneck for large repositories.
> In addition to generating random node ids, Jackrabbit should support 
> generating sequential node ids.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to