Hi Jesse, On Sat, Jun 20, 2009 at 10:49 PM, Jesse Grosjean <je...@hogbaysoftware.com>wrote:
> > I have a wiki like app. > > The basic model is a page which has title(StringProperty) and a body > (TextProperty) properties. It all seems to work well, but I'm not sure > how well my model will scale. The problem I see is that I want to have > an "Index" page, which lists all other pages. Showing every single page in the wiki isn't going to scale very well from either a datastore point of view, or a user-interface one - a list of thousands of entries is not generally very useful to users. :) > > My concern is when a model object is loaded in GAE all property fields > are also loaded in from the store at the same time. That would seem to > post a problem with my app on index pages, because it would mean when > someone visits the index page both the title (which I want) and body > (which I don't need) for all pages would need to be loaded from the > store. Loading the body in this case seems wasteful, and possibly very > problematic performance wise on a site with many pages. If you use the key_name functionality of the datastore, you can name Page entities after their titles, which will allow you to retrieve pages with a get operation instead of a query. It'll also mean you can do keys-only queries to retrieve a list of pages matching a particular query, without having to retrieve the page contents. > > My questions: > > 1. Is this a problem that other people are worrying about, should I > worry about it? I could solve the problem by dividing my page model > into two separate models... on that contained the title and a > reference to another model which would contain page body. That should > make the index page scale, but it complicates the rest of the app. I'd > prefer to avoid that rout if possible. That's also a possible approach, especially if you have other metadata you often want to retrieve without retrieving the body of the page. > > > 2. Is there, or is there a future possibility to specify that certain > fields in a model are lazy load, not fetched and returned in the > initial query? This is unlikely, since the entity is stored in the datastore as a single encoded Protocol Buffer. -Nick Johnson > > > Thanks, > Jesse > > > -- Nick Johnson, App Engine Developer Programs Engineer Google Ireland Ltd. :: Registered in Dublin, Ireland, Registration Number: 368047 --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---