简体   繁体   中英

How to redirect traffic for a Firebase Function to another region when current one goes down?

Suppose I have a callable function that is deployed to multiple regions.

My client side app does not specify region(but default is us-central1 ), so in the event where the default region goes down, does Firebase/Google Cloud automatically redirect traffic to other regions that are up?

If that wasn't the case, what to do in such scenarios?

I'm sure there's something, but my search attempts haven't reached anything.

No, each Cloud Function deployed has its own URL that also includes the region and requests would be routed to that function only. Cloud Functions don't have a load balancer like functionality by default. If number of requests rises, Cloud Functions will just create new instances to handle them.

You can check user's location, find the nearest GCP region where your function is deployed and call that. That should also reduce latency a bit and balance the requests based on user region.

Alternatively, if you want to ensure requests are handled by functions in same regions, also checkout Global external HTTP(S) load balancer with Cloud Functions .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM