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?
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.