And in another collection reference a "leaf" node:
"linkToLeaf": "<need to reference a leaf node. e.g. 'Level 1.2.1'>"
And will need to query data to:
render the tree so admin user can organize hierarchy (basic CRUD page)
display in some place the breadcrumb "You are in: Level 1 > Level 1.2 > Level 1.2.1"
establish link to "leaf node"
Using arangodb, what's the best way to model the data? Using graph, simple JSON documents, mix of both, something else?
I'm working on a new project and we want to make the jump to NoSQL but coming from background of traditional RDBMS I would simply model the tree using a recursive join and therefore and simply reference the "leaf node" using it's primary key.
There are several points that should have influence on your data model:
as in regular databases, joins don't come for free. Aggregating data from several collections into one document can be helpfull.
depending on what you want to update working with deeply structured documents can become challenging and produce hard to read AQL.
In your example you show something that seems very self similar, nested like a fractal.
You can for shure make this flat, and do what you did nested via graph traversals.
This can be benificial for your code on the client side, and you will not only be bound to a fixed number of layers;
Graph traversals produce a very nice behaviour and you can even iterate deeper dynamical.
The new ArangoDB pattern matching traversals could look like that: