Subrahmanya S M's photo

This question is regarding Firebase Rewrite for CloudRun and Architetcing Firebase hosting with cloud run region with Firestore region (while discussing with Cloud run developeres I got this) :

we understand that Firebase Hosting originates in us-central1 and CDN available across all regions, the problem is how to architect if we are based in India location

firebase hosting(locked to us-central1 ) +cloud run(which region we should select?)+Firestore(FB app created in MUMBAI (asia-south1))?

Question details:

Request path Scenario 1:

user/you(India)→India(CDN)→USA(Firebase us-central1)→ Singapore/Tokyo(CloudRun+aync call to Firestore India)→USA→CDN→you

which is REALLY BAD in terms of latency how to deal with it?

*I can't move or change / recreate my firebase app to us-central1 location.

1 possible solution is to use replace cloud run and build static sites by replacing firebase firestore SDK to cloud function with caching with a static site but we really need a SDK level firestore CDN solution to avoid this locked us-central1 firebase hosting us-central1 lock

another option is we need Firebase Hosting to originate in all 3 zones such that each zone have a separate firebase instance for using firebase hosting with rewrites to cloud run! otherwise cloud run users have to move to another local region hosting providers or move out of cloud run :(

Also cloud run SINGAPORE (asia-southeast1) region doesn't have rewrite access to firebase hosting please resolve this

Thanks you

Credits: @ahmetb for explaining Request path Scenario :)

Ref: stackoverflow.com/questions/62519384/cloud-..

Samuel Stern's photo

Yep this is pretty bad and we know it. The short answer is that there's not much you can do about it now and you may want to avoid Hosting → Run/Functions rewrites if your primary user base is far from us-central. The long answer is that we want to bring the Hosting "origin" to more places and the team is investigating how to do it!

Subrahmanya S M's photo

Samuel Stern this is great news about origin! I'm Super happy, thanks for responding :)