Re-reading my source, I am not totally sure whether "a change to one comment will be reflected in both entries": http://code.google.com/appengine/docs/java/datastore/relationships.html
Baz On Tue, Jun 2, 2009 at 1:02 PM, Baz <[email protected]> wrote: > The GAE datastore has the concept of relationships. It is implemented by > saving a collection of the related objects in a specific attribute. So if > you have a blog that has comments. You store a collection of comment objects > inside the blog attribute called 'comments'. If a second blog entry > references the same comment (which is wierd in this context I know) then > that comment is the same root comment for both entries. A change to that > comment will be reflected in both entries. > > So I was just wondering (couldn't find it in the docs) if you knew what the > limit was of related objects for a given attribute. Can you have 1000 > comments stored in the "Comments" attribute of the "BlogPost" object? What > about 10,000 or a million? there must be some limit. > > Similarly whats the longest string you can store in a string field - one > mb? > > Baz > > > > On Tue, Jun 2, 2009 at 11:53 AM, <[email protected]> wrote: > >> >> I'm not sure what the definitions of "relationships" and "attribute" >> are in this context. Can you elaborate on the question? >> >> Vince >> >> On Jun 2, 1:43 pm, Baz <[email protected]> wrote: >> > >> > Do you know the max number of relationships allowed in 1 attribute? >> > >> > Baz >> > >> > >> > >> > On Tue, Jun 2, 2009 at 10:24 AM, <[email protected]> wrote: >> > >> > > Yes, obviously when you get to that extreme (10,000 CFC instances) the >> > > developer is going to have to get smart about designing and accessing >> > > the datastore. Note that the CFQUERY and GoogleQuery syntax supports a >> > > "range" clause. When you get up to 10,000 entries, it might start to >> > > make more sense to query the datastore ("select from blogEntry where >> > > category = '#categoryName#' range 1,100") rather than doing batch >> > > reads based on keys. >> > >> > > Vince >> > >> > > On Jun 2, 1:06 pm, Baz <[email protected]> wrote: >> > >> > > > > Instead, I store the Google keys for the blogEntry.cfc instances >> > > > > within the blogCategory.cfc and read the blogEntry.cfc instances >> only >> > > > > when needed. >> > >> > > > If you had 10,000 blog entries or more this will probably break the >> app >> > > > because you would reach the attribute length limit (which I can't >> seem to >> > > > find, what is the max attribute size?). In cases like this, when it >> comes >> > > to >> > > > OO db's, I think it is recommended to choose the smaller side of the >> > > > relationship to store your data. So instead of storing all posts >> that a >> > > > category is related too in the category object, you would store all >> > > > categories a post is related to in the post object - there will only >> be a >> > > > few categories per post. To retrieve all posts for a certain >> category >> > > then, >> > > > you would do: >> > >> > > > SELECT FROM Post WHERE Category = 'App Engine' >> > >> > > > Baz- Hide quoted text - >> > >> > - Show quoted text - >> >> >> > --~--~---------~--~----~------------~-------~--~----~ Open BlueDragon Public Mailing List http://groups.google.com/group/openbd?hl=en official site @ http://www.openbluedragon.org/ !! save a network - trim replies before posting !! -~----------~----~----~----~------~----~------~--~---
