I remember reading a thread not long ago (
http://groups.google.com/group/google-appengine/browse_thread/thread/f69fe7dc4a9bc2ec)
about how put()'ing entities with near-sequential key names or IDs could
result in Datastore contention, since those entities would most likely be
saved on the same Bigtable tablet.
One solution in that thread to avoid Datastore contention mentioned setting
the key names to a hash (thus achieving non-sequential key names).
My question is does this sequential-causes-contention rule also apply to the
indexes updated when the entities are put()? I'm assuming the answer is Yes.
An example of what I mean. Let's say I'm taking snapshots of integer values
at particular points in time (say, every 5 minutes). So my model looks like
this:
class Snapshot(db.Model):
datetime = db.DateTimeProperty()
value = db.IntegerProperty()
def new_snapshot(d,v):
return Snapshot(datetime=d, value=v, key_name=sha1('%s-%s-%s %s:%s,%s' %
(d.year,d.month,d.day,d.hour,d.min,v))
If I then create 1000 entities which all have the same datetime value but
all have different value values, will I still encounter Datastore
contention, due to the datetime index being updated with 1000 values that
are identical, and hence (if my understanding of indexes is correct) will
most likely be written onto the same tablet?
Nick
--
You received this message because you are subscribed to the Google Groups
"Google App Engine" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-appengine?hl=en.