Imagine I have a tree structured like this
Countries->Counties>Towns
Imagine I want to find all towns that have a name attribute (for instance) ending in 'shire' where I know the country and county.
Is there any way of doing this other than finding the node for the country/county and then going through each leaf of the node, looking for entries that match ?
Similarly, if I want to find all towns called "Newtown" do I have to walk the entire tree or can I do some sort of query ?
My data is structured in a tree to save space but this seems to impose severe constraints on querying stuff (as far as I can see you can't do it), and you also can't have an indexed tree configuration for a cache.
Infinispan is a key-value store, and the tree API has been provided mostly for backwards compatibility with JBossCache, so, unless you really need that, please design your application to follow the flat approach.