简体   繁体   English

并发写入App Engine数据存储区的可伸缩性

[英]Scalability of concurrent writes to App Engine datastore

I'm thinking of dozens of concurrent jobs writing to the same datastore Model. 我正在考虑写入同一数据存储模型的数十个并发作业。 Does the datastore scale regardless of the number of concurrent puts? 无论并发数量多少,数据存储区都会扩展吗?

The datastore can only handle so many writes per second to any given entity . 数据存储区每秒只能处理任何给定实体的写入次数。 Trying to write to a specific entity too quickly leads to contention as described in Avoiding datastore contention . 尝试过快地写入特定实体会导致争用,如避免数据存储争用中所述。 This article recommends sharding an entity if you expect it be consistently updating it more than one or two times per second. 如果您希望实体每秒持续更新一次或两次,则本文建议对实体进行分片。

The datastore is optimized for reads, but if your concurrent jobs are writing to separate entities (even if they are within the same model) then your application might scale - it will depend on how long your request handlers take to execute. 数据存储区针对读取进行了优化,但如果并发作业正在写入单独的实体(即使它们位于同一模型中),那么您的应用程序可能会扩展 - 它将取决于请求处理程序执行的时间。

There is no contention for entity kinds - only for entity groups (entities with the same parent entity). 实体类型没有争用 - 仅适用于实体组(具有相同父实体的实体)。 Since you say you're writing to a new entity each time, you should be able to scale arbitrarially. 既然你说你每次都在写一个新的实体,你应该能够任意扩展。

One subtlety remains, however: If you're inserting a high rate of entities (hundreds per second), and you're using the default auto-generated IDs, you can get 'hot tablets', which can cause contention. 然而,还有一个细微之处:如果您插入高比率的实体(每秒数百个),并且您使用默认的自动生成ID,则可能会出现“热片”,这可能会导致争用。 If you expect that high a rate of insertions, you should use key names, and select a key that doesn't cluster as auto generated IDs do - examples would be an email address, or a randomly generated UUID. 如果您期望插入率很高,则应使用密钥名称,并选择不作为自动生成的ID进行集群的密钥 - 示例将是电子邮件地址或随机生成的UUID。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 阻止对 App Engine 数据存储区的并发访问 - Blocking concurrent access to App Engine datastore Google App Engine数据存储区并发修改异常 - Google App Engine Datastore Concurrent Modification Exception 并发写入时数据存储中的数据不一致 - Inconsistent data in datastore on concurrent writes 如何减少对Google App Engine数据存储区的读写次数 - How to reduce the number of reads and writes to Google App Engine datastore Google App Engine数据存储区中每秒写入5次以上的事务计数器 - Transactional counter with 5+ writes per second in Google App Engine datastore 并发写入 GAE 数据存储实体的不同属性 - Concurrent writes to different properties of GAE Datastore Entity 如何计算App Engine SDK本地测试环境中的数据存储区读取/写入总数? - How to calculate the total number of Datastore reads/writes in an App Engine SDK local test environment? App Engine:检查数据存储中数据更新的最佳方式,同时避免数据存储写入 - App Engine: Best way to check for updates to data in data store, while avoiding datastore writes Google App Engine数据存储写入:如何远程启用/禁用只读模式? - Google App Engine Datastore Writes: How to enable/disable read-only mode remotely? 对Google App Engine数据存储区中的所有用户使用相同的父密钥进行写交易是否合理? - Is it reasonable to use the same parent key for all users in Google App Engine Datastore to transact writes?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM