#community-help

Recommendations for Running Typesense on GCP

TLDR Alexandru asks about best practices for running Typesense on Google Cloud Platform (GCP). Kishore Nallan recommends using the Compute Engine and setting up a cluster if the data isn't fairly static.

Powered by Struct AI
yw1
8
22mo
Solved
Join the chat
Nov 11, 2021 (22 months ago)
Alexandru
Photo of md5-828e11a7dff2fb061b968a75c8ea1a00
Alexandru
01:12 AM
Are there any recommendations or best practises on how to run Typesense on GCP? Would you recommend to create 3 VM instances running on Compute Engine as a Cluster to achieve HA? I understand all indexing happens in memory so if a node dies, the db/indexing goes along with it.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
02:06 AM
👋 Alexandru How often you expect your data to change? If it's fairly static, you can even get away with hosting 2 independent instances and rely on background indexing and using alias to swap to the new collection.

Otherwise, yes, clustering is the best approach to have HA. Even though Typesense is in-memory, it can survive restarts because the raw data is kept on disk and is re-indexed on restart.
Alexandru
Photo of md5-828e11a7dff2fb061b968a75c8ea1a00
Alexandru
03:08 AM
I expect the data to grow to ~50M over the next few years and trying to estimate very roughly what would be required on our end.

What service would be best suited in GCP? Some of the data might fall under PII over time and we’d love to self-host it.
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
05:16 AM
The memory usage will depend on shape of data. You can index what you have and check how memory grows (there is some fixed overhead initially which should not be extrapolated).
Alexandru
Photo of md5-828e11a7dff2fb061b968a75c8ea1a00
Alexandru
01:47 PM
I guess Compute Engine is the only option in GCP? Can you establish a typesense cluster with google cloud run?
Kishore Nallan
Photo of md5-4e872368b2b2668460205b409e95c2ea
Kishore Nallan
01:48 PM
Yes, you have to use Compute Engine. set up 3 different instances and cluster them.
Alexandru
Photo of md5-828e11a7dff2fb061b968a75c8ea1a00
Alexandru
01:53 PM
Thanks so much for the help!
yw1