As to question 2. It depends what you use to interface with the
datastore. I can only speak for low-level datastore api, and in that
case, the whole thing gets loaded at once. So splitting your objects
into two entities would make sense.

On the other hand, remember that there is 1MB limit in the datastore,
so you may want to explore Blobstore API, so that your object now
looks like:

public class Story {
  private String mId;
  private String mTitle;
  private <something> BlobstoreApiKey; <- not large anymore
}

Cheers!

On Mar 18, 9:42 am, Tristan <[email protected]> wrote:
> I just want to suggest that you should probably use Long as a primary
> key. Initially there won't be any issues using String, but then
> eventually you'll run into something where you have the same titles
> and it will be a legitimate case, and you'll end up doing all sorts of
> gymnastics in order to allow them to coexist but still have unique
> primary keys. I haven't ran into any issues with Long primary keys
> yet.
>
> On Mar 16, 11:45 am, Mark <[email protected]> wrote:
>
>
>
> > Hi,
>
> > Kind of new to this, two questions if anyone can help:
>
> > 1) I want to make some class that is persistent on the data store. I
> > can use a primary key of either Long or String. It would be more
> > convenient for me to use String as the primary key. Is this going to
> > really hurt performance-wise when doing lookups for objects vs a Long?
>
> > 2) I have some objects which are somewhat large, like:
>
> >   public class Story {
> >      private String mId;
> >      private String mTitle;
> >      private String mFullText; <-- large
> >   }
>
> > if I want to get a list of Story items, I don't want to spend time
> > loading the mFullText parameter on each one. I can hold off on loading
> > that until a user wants to see the full story. Is there a way to
> > implement two different load methods for Story to control this? Or do
> > we simply break a class like this up into two separate classes:
>
> >   public class StoryDescription {
> >      private String mId;
> >      private String mTitle;
> >   }
>
> >   public class StoryText {
> >      private String mId;
> >      private String mFullText;
> >   }
>
> > and load as needed?
>
> > Thanks

-- 
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