I’m looking for a database system which has the following capabilities:
- Hierarchical (multi-dimensional) keys
- An ordering of keys at each dimension
So if my key is like App > User > Item I can run a query like: “what is the next item for this user?” Or “What is the next user for this app?”
I basically want a multi-dimensional tree. I found GTM, and am wondering if there are any other products like this.
Given your requirements I’d say that using multiple nested b-trees is a good solution.
You may also want to consider using a single b-tree and some clever key encoding so that for each segment in the key (path) there is a reserved min-token and max-token.
Having such a key would allow you to use standard b-tree access methods for your queries.
“what is the next item for this user” would be: find the key greater than
App > User > Item > **MAX**and, “what is the next user for this app” would be: find the key greater than
App > User > **MAX**For the second approach (key encoding instead of nested trees) any b-tree based No-SQL solution would suffice. Which one to choose depends on you programming environment and other requirements you might have.