title: "Too much contention" when creating new entity in dataStore
body: <p>This morning my GAE application generated several error log: "too much contention on these datastore entities. please try again.". In my mind, this type of error only happens when multiple requests try modify <strong>the same entity</strong> or entities in the <strong>same entity group</strong>. </p>
  
  <p>When I got this error, my code is inserting new entities. I'm confused. Does this mean there is a limitation of how fast we can create new entity?</p>
  
  <p>My code of model definition and calling sequence is show below:</p>
  
  <pre><code># model defnition
  class ExternalAPIStats(ndb.Model):
      uid = ndb.StringProperty()
      api = ndb.StringProperty()
      start_at = ndb.DateTimeProperty(auto_now_add=True)
      end_at = ndb.DateTimeProperty()
  
  # calling sequence
  stats = ExternalAPIStats(userid=current_uid, api="eapi:hr:get_by_id", start_at=start_at, end_at=end_at)
  stats.put()  # **too much contention** happen here
  </code></pre>
  
  <p>That's pretty mysterious to me. I was wondering how I shall deal with this problem. Please let me know if any suggestion.</p>