1 Reply Latest reply on Apr 11, 2014 11:14 AM by Randall Hauch

    Selecting a node by natural key

    Friso V Newbie

      Hi all,

       

      I've got a requirement for an external party to access some parts of our repository based on a natural key. Now I see myself having two options:

      • Make the natural key part of the path. In this way the external party can recreate the path and have an efficient access to the node.
      • Make a query that searches for properties on a node that have the natrual key as value. This has the advantage of being more flexible. If other parties come along that want a more complex natrual key, we can accomodate for that and I stay in control of my paths. It may come at a performace penalty however.

      So as a consequence I'm faced with the question of how big the performance penalty would be (under MS 3.7.2, so no option to create my own indices yet). Does anybody know?

       

      Groeten,

       

      Friso

        • 1. Re: Selecting a node by natural key
          Randall Hauch Master

          If your hierarchy already uses one natural key, then navigation would obviously work really well. However, if you have other natural keys then it is still appropriate in ModeShape 3.x to use a query to find nodes based upon one of those natural keys. ModeShape 3.x still uses a Lucene index under the hood, so it still should be quite fast.

           

          We are introducing explicitly defined indexes in ModeShape 4.0 to allow using other kinds of indexing technology (such as ElasticSearch, Solr, etc.), and to reduce the amount of work (and thus reduce the time) required to update the indexes. It's not clear whether or how this approach will change the query execution times. It's possible that queries could be faster because we'll be able to use a variety of perhaps more appropriate indexing technologies under the hood. But even if an explicitly-defined index uses Lucene, the query engine is different than in 3.x and it's too difficult to say one way or the other.