Hello, i have already deployed a typesense cluster...
# community-help
b
Hello, i have already deployed a typesense cluster and it works perfect (3 droplets, load balancer etc.) but it just came to my mind an other idea. How would typesense perform in Cloud Run? For example, if I have a fixed number of documents ~ 3k-5k (require max 50mb RAM) and deploy it in a 512mb RAM and 2-4 CPU cloud run instance. Would it be suitable to serve unlimited clients, without the need of clustering etc? Would the data be corrupted across multiple instaces? If I set only 1 read (warm) instance, would the data be shared in other respawned instances if required?
k
I'm not familiar with cloud run but where would the data be stored persistently?
b
Yes that's an issue. As I read in their docs each instance will be destroyed after request execution
m
Cloud Run is stateless. Maybe you can use GAE.
👍 1
c
AFAIK cloud run instances can't communicate with each other and you can't really control the lifetimes, so it's unsuitable to use for Typesense IMO
container optimized compute instances seem like the easiest solution to use and also give the most CPU + memory bang-for-the-buck
t
If you want to do FTS and filtering on that small amount of products with unlimited scaling, I'd suggest using https://github.com/nextapps-de/flexsearch and AWS Lambdas, they allow 500MB of tmp space and the instances stay alive as long as they have requests. I've tried up to 10K products and had latencies below 300ms
The actual index can be stored in S3, it has read speeds of 700MB/s when run in Lambdas
3M searches would cost 5$/mo