数据库设计在谷歌应用程序引擎 [英] database design in google app engine

查看:104
本文介绍了数据库设计在谷歌应用程序引擎的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在设计一个简单的基于项目列表的项目。这个想法是在项目中定义任务(没有工作流程 - 只是任务完成或不需要)。即每个任务具有多个任务,并且该任务可以具有其他多个任务。如果该项目的所有任务完成,可以说项目完成。 ,我想使用refrenceproeperty来创建等级,但是找不到简单的方法(找不到项目的所有孩子并且检查天气完成不需要30多秒)。以检测项目是否完成。如何设计这样的工作的数据库?而且,如果我需要复制项目以定义另一个项目,如何复制分层数据?

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 ?

推荐答案

与其他nosql数据库一样,App Engine数据存储的首要理念是做你的工作,而不是在读。考虑到这一点,您可以像Adam所说的那样使用父母关系,并在每个节点上保留不完整的计数,它计算尚未完成的直接孩子的数量。当您标记一个节点完成时,减去其父节点的计数;如果这导致它完成,移动到其父级等等。使用这样的结构,您可以立即显示任务是否完成。

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.

这篇关于数据库设计在谷歌应用程序引擎的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆