Do you recommend using two tables or one?

With one table, it can look something like this.

class Image
  data = blobField
  width = Int
  height = Int

with two tables

class ImageInfo
  width = Int
  height = Int
  image = refToImage

class Image
  data = blobField

Advantages with one table:
  One query to get both the dimension and its blob.
Disadvantages
  Wasting bandwidth if you're only interested in the dimension. Unless
you have a way of lazyloading the blob.
  The dimension can cut into the 1MB size limit of the document.

Advantage of two tables:
  Don't have to load the blob if you only want the dimension.
  The blob can use the full 1MB size limit.
Disadvantage.
  Need to perform two queries if you want both the dimension and the
blob.

--

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-appeng...@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.


Reply via email to