最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Do firebase functions triggered when a document is created scale to thousands of documents being added to firestore simultaneous

programmeradmin4浏览0评论

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?

Share Improve this question asked Mar 23 at 0:04 yamboyambo 1,8503 gold badges22 silver badges42 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Yup, 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.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论