AppEngine - 写入限制为每秒1次 [英] AppEngine - Writes are limited to 1 per second

查看:80
本文介绍了AppEngine - 写入限制为每秒1次的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在研究将AppEngine DataStore用于数据库系统,但我在文档中引用了这个引用:

这允许对单个留言簿的查询具有强烈的一致性,但也会将留言簿的更改限制为每秒1次写入(实体组的支持限制)。

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



现在是否意味着如果我的数据模型设置如下所示:

 类留言簿(db.model)
guestbook_name =字符串属性
datecreated =日期属性

类Message(db.model)
guestbookOwner =留言板引用
messageText =字符串属性
datecreated =日期属性

无论我用什么数据提交消息,即:

  mess = Message()
mess.guestbookOwner =留言簿
mess.put()

它仍然会被限制为每秒1次写入? - 我不介意它是否受限于此,如果它基于留言簿引用和新消息。



请帮助!



谢谢

克里斯

解决方案

嘿,不过,引用另一个实体并且与另一个实体属于同一个实体组是两个独立的事情。



实体只属于同一个实体组当父母参数rel =noreferrer>实例化其中之一。对实体类进行建模以使其具有对另一个实体的引用并不意味着在构建它时需要给它一个,因此并不意味着它必须属于与其他实体的实体组。

具有高度复制的每秒写入限制适用于实体组,因此如果您不父母您的实体彼此,每个实体将是它自己的独奏实体组。在这种情况下,每秒写入限制将适用于每个实体,而不是跨实体。


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

解决方案

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.

这篇关于AppEngine - 写入限制为每秒1次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆