admin管理员组文章数量:1401444
I have a Firestore database that I'll be adding ~10k documents to every hour. I need to run a function on each of those documents that makes an API call, gets some information, and updates said document.
Is a Firebase function with the on_document_created
trigger suited to do this for thousands of documents simultaneously? Or is there a solution that makes more sense for this use case?
I have a Firestore database that I'll be adding ~10k documents to every hour. I need to run a function on each of those documents that makes an API call, gets some information, and updates said document.
Is a Firebase function with the on_document_created
trigger suited to do this for thousands of documents simultaneously? Or is there a solution that makes more sense for this use case?
1 Answer
Reset to default 0Yup, both Firestore and Cloud Functions scale to that level fine.
If the load is spread out evenly, 10K an hour breaks done to a handful of documents/triggers per second, which is quite low by GCP standards - and there's likely nothing specific needed in preparation.
If the load comes as a spike during that hour, it can handle it fine too - but I recommend that in that case you study the documentation on Best practices for Cloud Firestore, paying extra attention to the section on ramping up traffic, and also start reading Understanding reads and writes at scale.
本文标签:
版权声明:本文标题:Do firebase functions triggered when a document is created scale to thousands of documents being added to firestore simultaneous 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744300300a2599547.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论