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?

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.

本文标签: