AppEngine - Writes are limited to 1 per second

2019-07-22 00:09发布

I'm looking into using the AppEngine DataStore for a database system, but I'm confused by this quote in the documentation:

"This allows queries on a single guestbook to be strongly consistent, but also limits changes to the guestbook to 1 write per second (the supported limit for entity groups)."

Source: http://code.google.com/appengine/docs/python/datastore/hr/overview.html

Now does that mean that if I have my data model setup like:

class Guestbook(db.model)
    guestbook_name = string property
    datecreated = date property

class Message(db.model)
    guestbookOwner = guestbook reference
    messageText = string property
    datecreated = date property

No matter what data I commit with a message, ie:

mess = Message()
mess.guestbookOwner = guestbook
mess.put()

It will still be limited to 1 write per second? - I wouldn't mind if it were limited like this, if it were based on the guestbook reference and the new message.

Help please!

Thanks

Chris

1条回答
Explosion°爆炸
2楼-- · 2019-07-22 00:25

Hey, nope, having a reference to another entity and belonging to the same entity group as another entity are two independent things.

Entities belong to the same entity group only if you explicitly supply a parent argument when you instantiate either of them. Modeling an entity class so that it has a reference to another entity doesn't mean you're required to give it a parent when you construct it and therefore doesn't imply that it has to belong to an entity group with other entities.

The writes-per-second limit with High Replication applies to entity groups, so if you don't parent your entities to one another, each entity will be its own solo entity group. In that case, the writes-per-second limit will apply to each entity, not across entities.

查看更多
登录 后发表回答