#community-help

Improving Firebase Cloud Function to Typesense Cloud Server Performance

TLDR Zhen asked advice for reducing latency between Firebase Cloud Function and Typesense Cloud. Jason suggested using a SDN cluster or moving the function closer to the majority of users.

Powered by Struct AI

1

5
13mo
Solved
Join the chat
Sep 27, 2022 (13 months ago)
Zhen
Photo of md5-4dfb5d22f4011c76b348de581fb4af0c
Zhen
04:55 PM
Hi guys! I have my Firebase Cloud Function hosted in the US and my Typesense Cloud server hosted in Singapore. A single document update from the Cloud Function took more than 900ms to complete.

Is there any advise / suggestion to improve the performance? Thanks!
Jason
Photo of md5-8813087cccc512313602b6d9f9ece19f
Jason
04:57 PM
This latency is expected given the physical distance between the US and Singapore.
04:58
Jason
04:58 PM
You could use an SDN cluster with say one node in the US, one node in Singapore and one node in another region, then writes from your US-based cloud function will reach the Typesense Cloud node in the US, which will reduce the initial latency
04:59
Jason
04:59 PM
Alternatively, for a single node cluster, you would have to have it close to your cloud function if write performance is what you want to optimize for
Sep 28, 2022 (13 months ago)
Zhen
Photo of md5-4dfb5d22f4011c76b348de581fb4af0c
Zhen
12:46 AM
Hi Jason, thanks for your advice! Will try to move the cloud function location since most of my users are near Singapore. Cheers!

1