App Engine Datastore - consistency and 1 write per sec limitation - who will it work in the following scenarious -


i'm trying wrap head around eventuality consistency , 1 write per sec principles in gae datastore. have scenario , 2 questions:

#python pseudo-code class user:    user_id = stringproperty    last_update_time = datetimeproperty  class comment:        user_id = stringproperty    comment = stringproperty  ... def addcommentandreturnallcomments(user_id):     user = db.gqlquery("select * user user_id = :1", user_id)      user.last_update_time = datetime.now()     user.put()      comment = comment(parent=user(user_id))     comment.put()      comments = db.gqlquery("select * comment user_id = :1", user_id)        return comments 

questions:

  1. will exception here because make 2 writes same entitygroup within 1 second (user.put , comment.put)? there simple way around it?
  2. if remove parent=user(user_id), 2 entities no longer belong same entitygroup. mean list of comments returned function might not contain last added comment?
  3. am doing inherently wrong?

i know got entity referencing part wrong. doesn't matter question (or it?)

  1. this seems soft limit. in practice see 5 writes/s allowed.

  2. yes , happens now, because not using ancestor query.

  3. nothing, except mentioned in point 2.


Comments

Popular posts from this blog

Perl - how to grep a block of text from a file -

delphi - How to remove all the grips on a coolbar if I have several coolbands? -

javascript - Animating array of divs; only the final element is modified -