Hierarchical data structures are often stored in relational databases. This kind of storage is flexible but flat, so the tree structure has to be build with each query. I want to store forum posts as a tree structure, but it should be possible to query efficiently, say for example selecting posts by date or author.
I'd like to have an open source database that is accessible from Java.
What is the best way to do so? CouchDB? neo4j? ...?
When I first encountered this problem, I've found the great article (link).
In tho words: in RDBMS world there are 2 main tree model storage approaches: