The most brief explanation I can offer is this: think of the datastore as a
giant key-value store. Design your persistence to this model as much as
possible such that you can do as much using get by key. Minimize the total
phases of RPCs - remember that you can batch get keys. Use queries sparingly
and only when there's no way to do what you want to do using keys.

Ikai Lan
Developer Programs Engineer, Google App Engine
Blog: http://googleappengine.blogspot.com
Twitter: http://twitter.com/app_engine
Reddit: http://www.reddit.com/r/appengine



On Wed, Jun 15, 2011 at 2:42 PM, Owen <[email protected]> wrote:

> Ikai
>
> Could you expand on this example a bit, or provide a link that
> discusses it? I'm very interested in best practices for datastore
> structure. I've read a number of comments that indicate that
> ReferenceProperty implementations can be datastore intensive and that
> it's better to find creative ways to denormalize data. This sounds
> like one of them, but I'm having trouble visualizing what you describe
> here.
>
> Thanks,
> Owen
>
> On Jun 14, 10:44 am, "Ikai Lan (Google)" <[email protected]> wrote:
> > Better implementation: define a Person model and a fields Text type where
> > you store additional data as a JSON object. Store a "type" attribute.
> Then
> > wrap the Person class with Teacher for all types that have the "Teacher"
> > attribute.
> >
> > Ikai Lan
> > Developer Programs Engineer, Google App Engine
> > Blog:http://googleappengine.blogspot.com
> > Twitter:http://twitter.com/app_engine
> > Reddit:http://www.reddit.com/r/appengine
> >
> >
> >
> >
> >
> >
> >
> > On Tue, Jun 14, 2011 at 3:29 PM, Bruce Aloe <[email protected]> wrote:
> > > Hello,
> >
> > > I want to define two kinds (tables): Person (PersonId, age, name) and
> > > Teacher (PersonId, age, name, teaching experience) in my GAE datastore
> > > and Person is the superclass of Teacher. I want to define inheritance
> > > relationship between Person and Teacher, so Teacher kind inherites
> > > PersonId, age, name columns (attributes) from Person kind.
> >
> > > Is there any way to define it in python environment from GAE?
> >
> > > Thanks!
> >
> > > Bruce
> >
> > > --
> > > You received this message because you are subscribed to the Google
> Groups
> > > "Google App Engine" group.
> > > To post to this group, send email to [email protected]
> .
> > > To unsubscribe from this group, send email to
> > > [email protected].
> > > For more options, visit this group at
> > >http://groups.google.com/group/google-appengine?hl=en.
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected].
> For more options, visit this group at
> http://groups.google.com/group/google-appengine?hl=en.
>
>

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

Reply via email to