How to populate a Tree with flat JSON?

What database lets you store and traverse a tree and access each node via a RESTful url?

  • for example localhost/root/parent1/child3/node will show a json document localhost/root/parent2/ will list an array of json documents (children). localhost/root?byDate='23/2/2013' will give me a fully explorable tree via rest api but only containing nodes with date matching the query.

  • Answer:

    What you're describing here is a tree, not a true graph. A tree is a subset of all possible graphs. Such a thing could be done with a thin API wrapper around Neo4J (or other kinds of databases, including relational), but the graph databases available tend to be more flexible than this expression.

Dave Stagner at Quora Visit the source

Was this solution helpful to you?

Other answers

Check out firebase .. Its a hosted database service really.. Not an actual database.. But the data model you describe looks much like what they have.. https://www.firebase.com

Vinoth Chandar

Dave has a point, there is no need to force a database to provide access via a URL. A web service wrapper would be much better suited for this and would give you freedom to choose whatever back-end you want. In your case even XML files may do the trick. Of course there are several relevant considerations such as scalability, fault tolerance, number of concurrent queries, types of queries and so on, and that can all effect the DB choice. If you implement a wrapper you don't have to worry about all that at once. separate and conquer.

Mordechai Danielov

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.