Ad

Does Firebase Cloud Function Trigger Parallel Or One By One?

I am working on a firebase project. I have a cloud function that triggers on a change of a value of one of my collection in my RealTimeDB.

If a Bulk of changes are applied in the same time, how does it invoke my cloud function? Will it invoke the cloud function at the same time , or will it call my cloud function in a sequential order, like one by one.

I am just worried because ,this cloud function has to fetch a value from another collection, which will vary from time to time. And if the order of execution changes, They may fetch a wrong value at that time.

Ad

Answer

Cloud Functions does not guarantee any ordering of events. Events could be processed in parallel, as there could be multiple server instances handling them simultaneously. You will need to take this into account if events could be generated rapidly under load.

Ad
source: stackoverflow.com
Ad