google-app-enginecontention

Avoiding contention in AppEngine


I am trying to wrap my head around contention and how it applies to the Application Engine stack.

I have a model that is build like so

class Events(db.Model):
    #Owner Identification Number
    owner_id        = db.StringProperty(required=True)

    #Authentication Token
    auth_token      = db.StringProperty(required=True)

    #generic, b, c, d, ...
    driver          = db.StringProperty(required=True)

    #Start Time and Date
    tStart          = db.DateTimeProperty(auto_now=True)

    #Define whether the event is active or inactive
    active          = db.BooleanProperty(default=False)

    #Payload store, this will store each payload block sent or pulled
    payloads        = db.StringListProperty(indexed=False)

This model holds several events, each event has an owner and a payloads, the owner of the event will be writing payloads to and from his event and many others will be reading from the event, it's sort of a transcription stack.

My question is about contention, Will I be effected by this and if so how can I restructure to prevent it.

Thank you.


Solution

  • I don't see any problem with your Model :

    1. Events entities will not pay any contention tax as they seem, judgding from your words and example , just root entities outside any entity group.
    2. A frequent update on a single entity can cause contention but I hardly doubt that the owner will update any entity more than one time per second (1QPS is the threshold you have to keep in mind, above that you are in the danger zone).
    3. Datastore read operations do not cause contention problem.