A limit clarification for the new Firestore

半腔热情 提交于 2019-11-30 19:30:22

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.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!