On Thu, Jul 30, 2009 at 3:34 AM, Mark Jones <mark0...@gmail.com> wrote:

>
> I'm using the AppEnginePatch to get a fairly useful Django
> implementation.  The problem I've run into is that parent/child/
> ancestor relationships aren't well supported.  I've found a less than
> pretty workaround for the moment.
>
> The link to this discussion is
>
> http://groups.google.com/group/app-engine-patch/tree/browse_frm/thread/d1399dee0fe6bd08/1fcac449684ce388?rnum=1&_done=%2Fgroup%2Fapp-engine-patch%2Fbrowse_frm%2Fthread%2Fd1399dee0fe6bd08%3F#doc_1fcac449684ce388
> ,
> but here are my design thoughts.
>
> Account:  (Parent)   one per user
>  Item: (Child) 1000 or so per user
>
> I think that to do this optimally in the appengine with 100,000,000
> rows and 100,000 users is to cluster the data around the account.  So
> that the Account is the parent to the Items on a per user basis.
> Account is the parent/ancestor of Items that belong to that account.
>
> Is this just over design on my part?  Will ReferenceProperties work
> just as well?


There's no significant performance advantage to using parent entities.
Athough the data is stored together, that doesn't translate to a significant
performance increase when fetching them, and because writes to an Entity
Group are serialized (to ensure transactional consistency), it can actually
decrease write throughput. Only use entity groups if you need transactional
consistency across multiple entities in the group.


>
>
> I'm thinking about this from the stand point of wanting to see all the
> Items from Sam's account.  I don't want to search for Sam's items
> across 100,000,000 rows, I want to open up Sam's account by key, then
> search across the 1000 rows that belong to Sam.


Assuming your query is indexed, finding items that belong to Sam and match
some other criteria is no less efficient using ReferenceProperties than it
would be using Parent relationships.

-Nick Johnson


>
>
> Could someone that actually understands the insides of the Datastore
> tell me I'm right or wrong?
>
>
> >
>


-- 
Nick Johnson, Developer Programs Engineer, App Engine

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google App Engine" group.
To post to this group, send email to google-appengine@googlegroups.com
To unsubscribe from this group, send email to 
google-appengine+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/google-appengine?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to