Storing Directory Hierarchy in a Key-Value Data store
The method you currently use now is called adjacency list model. Another model to store hierarchical data in a (relational) database is the nested set model. Its implementation in SQL databases is well known. Also see this article for the modified preorder tree traversal algorithm. A very simple method: you could store a path per … Read more