Not necessarily.  Just because the datastore prefers big objects doesn't
mean your problem domain isn't better off with a bunch of smaller ones.  In
particular, you should never embed a time series (presumably like
EnergyReading) since its growth is unbounded.

On the other hand, you might find that Company/Building makes a good case
for embedding, or Building/EnergySupply.  It's not all one or the other.
 However, it sounds like you've landed on an answer that you are happy
with, so as long as your fetch & query times are reasonable... stick with
it.

Jeff

On Thu, Feb 23, 2012 at 6:14 AM, Drew Spencer <[email protected]> wrote:

> So does this mean I'm going about building my app structure the wrong way?
>
> I'm building something that has a structure something like this:
>
> Company --> Building --> EnergySupply --> EnergyReading
>
> In each case the relationship is a hasMany, so there could be a Company
> that has say 100 Buildings with dozens of EnergySupply objects on each and
> then dozens of Readings on each... I'm currently storing each list of child
> entities as a List<Key<T>> in the entity using Objectify. Should I be using
> @Embed or something like that? I currently have an MVP triplet for each
> page to allow users to view and edit each object, and every time I load a
> page I am making a call to the datastore. It's just a simple get() using
> Ofy because I am passing the key in as part of the history token, so isn't
> that going to be quite fast? I don't see the need to load the data from
> every EnergyReading, EnergySupply and Building a Company has if the user
> just wants to go to the company details page, add a phone number and then
> do and do something else. Any advice on this kind of structure? Some kind
> of lazy loading perhaps? Tell me to RTFM if there's something I'm totally
> not getting.
>
> Thanks,
>
> Drew
>
> --
> You received this message because you are subscribed to the Google Groups
> "Google App Engine" group.
> To view this discussion on the web visit
> https://groups.google.com/d/msg/google-appengine/-/388hWgtS6fUJ.
>
> 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