2
votes

Will different firestore and functions+hosting increase billing costs+latency compared they would be on same location?

I have a Firebase project where I use Firestore, functions and hosting. Default GCP resource location and Firestore location is eur3 (europe-west). Main usage of app is aimed to europe

I noticed after setting this location that docs state: If you are using HTTP functions to serve dynamic content for Firebase Hosting, you must use us-central1. And: Firebase Hosting supports Cloud Functions in us-central1 only.

Would it be more optimal to have all locations on us-central1 even thought apps main usage/target audience is in europe?

2
This is something you should benchmark for your specific use cases. - Doug Stevenson

2 Answers

1
votes

It would not be optimal to have all locations on us-central1 as the latency is definitely going to be higher than hosting on the same region, although how much higher, that would highly depend on your use case. The cost will also be different, but probably not by much. Here's the GCP Calculator in case it helps.

1
votes

Ideally you would have your hosting and functions in the same region. More importantly for latency when using functions but also cost.

You will pay for ingress and egress traffic when calling a function if the function is in a different region than your hosting.

Firebase does allow you to host functions in multiple locations.

https://firebase.google.com/docs/functions/locations