I cannot seem to find a solid answer on this. I am a novice when it comes to Ravendb, so any help will be much appreciated. I am looking to build a recursive menu. What would be the best way to do this? I looked at this feed RavenDb – Recursive queries/indexes, for Hierarchical Document, and was unable to find the ‘recommended’ solution. Do I just store all the child documents as denormalized data inside the parent document? I was thinking of storing the id of the document/page, and the document/page ‘slug’. This seems viable since this is all the info I will need when building the menu, but what happens if the page title changes? I would then need to change the slug of the page, which means I would have to update the page parent. What happens if the page is deleted to? Do I just apply a patch? How does this method differ from using Live Projections? If anyone maybe has built a hierarchical-tree-app using Ravendb, that mimics ‘best practices’, I would be forever grateful.
Thanks
Tyrone
How are you implementing the Menu? You may want to take a look at this Tree implementation as a reference.
I would start by storing the whole Menu (your tree structure) data as a single document in RavenDB.
RavenDB’s client is very good in terms of caching so even if you end up with a big document for the navigation that shouldn’t be a problem as it will be always in memory.