Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

database design in google app engine

i am designing a simple project based to do list. the idea is to define tasks under project ( no workflow - just "task is completed" or not is required. ) in a hirarchial way. i.e. each task has multiple task and that task may have other multiple task. a project can be said to be completed if all task under that project are completed. , i tought of using refrenceproeperty to create hirarchy , but could not figure out easy way ( which do not take more than 30 seconds to find all the children of a project and check weather it is completed or not ) . to detect if project is complete or not. how to design database for such job ? and also , if i need to copy the project in order to define another project , how to copy hierarchical data ?

like image 759
iamgopal Avatar asked Aug 24 '26 23:08

iamgopal


1 Answers

The overriding philosophy of the App Engine datastore, as with other nosql databases, is to do your work on write, not on read. With that in mind, you could use parent relationships, as Adam suggests, and keep an 'incomplete count' on each node, which counts the number of immediate children that aren't yet complete. When you mark a node complete, decrement its parent node's count; if that causes it to be complete, move to its parent, and so forth. With a structure like this, you can instantly show if a task is complete or not.

like image 194
Nick Johnson Avatar answered Aug 26 '26 22:08

Nick Johnson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!