擅长:python、mysql、java
<p>不应使用实体组来表示实体关系。你知道吗</p>
<p><a href="https://cloud.google.com/appengine/docs/java/datastore/transactions#Java_Entity_groups" rel="nofollow">Entity groups have a special purpose</a>:定义事务的范围。它们使您能够以事务方式更新多个实体,只要它们是同一实体组的一部分(新的<a href="https://cloud.google.com/appengine/docs/java/datastore/transactions#Java_cross-group_XG_transactions_using_the_Java_low-level_API" rel="nofollow">XG transactions</a>稍微放宽了这个限制)。它们还允许您在事务中使用查询(不可通过XG事务使用)。你知道吗</p>
<p>实体组的缺点是它们的更新限制为1次写入/秒。你知道吗</p>
<p>在你的情况下,我的建议是使用不同的实体,并在它们之间作参考。引用应该是被引用实体的键,因为这是类型安全的。你知道吗</p>
<p>关于查询的简单性:不幸的是,GAE不支持连接或引用(多实体)查询,所以您仍然需要将多个查询组合在一起(就像您现在所做的那样)。你知道吗</p>