I am moving from PHP/MySQL to Google App Engine and using JDO as interface with the datastore. What’s the recommended way of migrating a Modified Preorder Tree Traversal (MPTT) enabled table to a JDO model?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
After spending some time searching on the different ways to implement hierarchical data storage on GAE datastore, I decided to try a direct MPTT implementation. The following code snippet presents the model:
The solution works pretty well if the datastore operations are read intensive, but it’s quite “heavy” when the operations are write intensive. This fact in combination with the time limitations within which an operation must be completed in GAE, makes this solution less appealing.
Another approach that seems to be more efficient is to store the full list of parents and children for each node in the hierarchy.
Some useful links on hierarchical data storage on GAE datastore are the following: