A limit clarification for the new Firestore

后端 未结 2 422
我在风中等你
我在风中等你 2021-01-05 00:33

So in the limits section (https://firebase.google.com/docs/firestore/quotas) of the new Firestore product from Firebase it says:

Maximum write rate to

相关标签:
2条回答
  • 2021-01-05 01:05

    Sorry for the confusion; an example might help.

    If your user documents contained a last-updated timestamp and you index on that timestamp then each new write would end up clustering around the same value (now) creating a hotspot in the index.

    Similarly if you somehow assigned users a sequential value like a place in line or something like that this would also create a hotspot.

    Incidentally this is why generated document IDs are random strings. This evenly distributes the writes on the primary key index.

    If you avoid these kinds of patterns the sky's the limit, though during beta you'd hit the database-wide limit.

    0 讨论(0)
  • 2021-01-05 01:10

    A quick additional note : for the moment all properties are indexed by default, so if you had a last-updated timestamp it would necessarily be indexed - so you would not be able to avoid the hotspoting.

    Index disablement will be available down the road though.

    0 讨论(0)
提交回复
热议问题