VonD
VonD

Reputation: 5155

Do firebase cloud functions have an impact on database load?

When a firebase cloud function does not perform any read/write operation on the database that triggered it, does it under the hood perform a read operation on the node that triggered it ?

In other words, can we consider that cloud functions are basically free performance-wise if they do not perform any additional operation, or can they make database load grow, especially when they're hooked on an often written-to node ?

I'd be very grateful if you had insight on this / experience with using many cloud-functions on write intensive nodes - or some pointers to relevant parts of the documentation, i could not find any. Thanks !

Upvotes: 2

Views: 30

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317362

When a firebase cloud function does not perform any read/write operation on the database that triggered it, does it under the hood perform a read operation on the node that triggered it ?

No, the contents of a database change are delivered to the function without any further reads. If the function does not itself read or write the database, nothing else happens with the database.

In other words, can we consider that cloud functions are basically free performance-wise if they do not perform any additional operation, or can they make database load grow, especially when they're hooked on an often written-to node ?

I would not call the functions "basically free". You are still paying for the cost of each function invocation. But it is fair to say that a function that does nothing when invoked will not work against any limits that the database might have, and it does not incur any extra billing from the perspective of the database product on its own terms.

Upvotes: 2

Related Questions