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:
- will exception here because make 2 writes same entitygroup within 1 second (user.put , comment.put)? there simple way around it?
- 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?
- am doing inherently wrong?
i know got entity referencing part wrong. doesn't matter question (or it?)
this seems soft limit. in practice see 5 writes/s allowed.
yes , happens now, because not using ancestor query.
nothing, except mentioned in point 2.
Comments
Post a Comment