最近,我试图研究这个主题,涉及云数据存储的热点行为。据我了解,在单调上增加的索引字段的阅读/写作可能会导致高读/写入期间性能的争论和降解。
现在,关于单调增加但更粗糙的田地的情况如何。以代表事件日志的一种例如一种。如果每个事件的日期字段与发生的日期相对应,则可以每天查询。在这种情况下,直到随后的一天,该领域将保持恒定(直到单调增加)。这会导致争夺与在高写入期间使用高精度的时间戳类似吗?
I have tried to research this topic a lot lately, regarding the hotspotting behavior of Cloud Datastore. As I understand, reading/writing to indexed fields that are monotonically increasing can lead to contention and degradation of performance during high read/write load.
Now, how is it with regards to fields that increase monotonically but on a more coarse level. Take for instance a kind that represent a log of events. If each event has a date field corresponding to the day at which it occurred, such that one can query on a day to day basis. In this case the field will remain constant (not monotonically increasing) until the subsequent day. Will this lead to contention similarly to using a high precision timestamp during a high write load?
发布评论
评论(1)
对于您的问题:
根据时间戳字段在任何查询中,您都可以通过不索引时间戳字段来删除每秒500个写入。”为此添加:
如果您的实体/键共享一个共同的日期前缀,但具有完全随机的后缀,则旧平板电脑(带有旧日期前缀)将不会共享负载。例如,如果您想通过时间戳查询条目,但只需要一次返回单个用户的结果,则可以将时间戳以
userId
和索引新属性索引。最后,如果您要添加时间戳/日间属性,并且 index 这种方法似乎遇到了热点。
有关更多参考,您可以查找:
For your question:
According to this "If your app doesn't use the timestamp field in any queries, you can remove the 500 writes per second limit by not indexing the timestamp field." To add in this:
If your entities/keys share a common date prefix, but have a completely random suffix, then old tablets (with old date prefixes) won't share the load. For instance, if you want to query for entries by timestamp but only need to return results for a single user at a time, you could prefix the timestamp with the
userId
and index that new property instead.Lastly, if you are looking to add a timestamp/day property, and index it, this approach seems to encounter hotspotting.
For more reference, you can look up: High read/write rates to a narrow key range