Jamie Curnow
Jamie Curnow

Reputation: 794

Firebase Functions quota when serving locally using firebase serve --only functions

TL;DR:

Does my firebase project incur charges/use up quota by running firebase functions locally using $firebase serve --only functions?

Details:

I have a collection in my firestore database called locations with thousands of documents that include location data such as address and postCode. I want to add some geolocation data to each document using an external api service (Open Postcode Geo API). I've written an HTTP-triggered firebase function, triggered by hitting the endpoint /api/geocodeLocations. This cloud function will run through each document in the locations collection and use the postCode data to make an api call to Open Postcode Geo which will respond with the geolocation data (along with other data). It will then get the data it needs from the response and write it to the document in firestore.

I am aware that if I deploy this function and call it by hitting https://my-project/api/geocodeLocations, I will start racking up my quotas and maybe incur charges for the amount of external requests that it's making (and more than likely time out...). However, if I run $firebase serve --only functions locally on my dev machine to emulate functions and then hit the url http://localhost:5000/my-project/us-central1/app/api/geocodeLocations, will I still rack up quotas for external requests?

I don't think I will, as the requests are between my local machine and the external api, but I can't find any firebase documentation on quotas when running locally.

Thanks in advance!

Upvotes: 1

Views: 234

Answers (1)

Doug Stevenson
Doug Stevenson

Reputation: 317828

Running functions locally in any way doesn't cost anything in terms of billing or quota for the Cloud Functions product.

If you read data out of Firestore or Realtime Database in a function running locally, you will still be billed for that access, but it won't be in relation to Cloud Functions billing or quotas.

Upvotes: 1

Related Questions