有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

祖先关系中的java数据存储限制

我正在使用Java。我这里有一个简单的场景。有四种:1-用户、2-帖子、3-评论、4-类

祖先关系是这样使用的

 user---->post---->comment
           -
           ------->Like    

用户是帖子的父级,评论和喜欢的父级。Post是评论和类似内容的父对象

在我的应用程序中,我主要需要最近3条评论的帖子。当用户点击“评论”按钮时,就会得到该帖子的所有评论,同样的评论也会被喜欢。比如Facebook和Instagram。我认为在这种情况下,上面的结构(关系)是有用的,不是吗

但问题是,如文件中所述,最大运行速率为1/s。如果您从该操作中增加,则可能会出现错误

There is a write throughput limit of about one transaction per second within a single entity group. This limitation exists because Cloud Datastore performs masterless, synchronous replication of each entity group over a wide geographic area to provide high reliability and fault tolerance. Documention

Avoid writing to an entity group more than once per second. Writing at a sustained rate above that limit makes eventually consistent reads more eventual, leads to time outs for strongly consistent reads, and results in slower overall performance of your application. A batch or transactional write to an entity group counts as only a single write against this limit. Documention

很有可能在一秒钟内有不止一个“喜欢”或“评论”。所以我在这种情况下会做什么

有什么建议我如何克服这种情况或其他更好的结构


共 (0) 个答案