Need help scaling and for performance
geongeorge
PROOP

a year ago

We are building a app that is going to expose the api which is going to be send to an email list of 400k people very soon. We have been using railway for almost 2 years now on the pro plan. Everything has been smooth.

I have a simple remixjs app (with postgres and redis) with an api endpoint which needs to scale and be performant for everyone across the world. How do I do it if the api is dependant on postgres which is locked to one location

I'm also looking at fly if nothing works. I wanted to do what I could by sticking on to the platform. Since multi region for postgres and redis is not available, how do we speed up for users around the world?

I saw you have a banner on postgres HA cluster is not battle tested so not confident in using that as well.

Solved

15 Replies

geongeorge
PROOP

a year ago

Project ID: cdab2de9-2da0-4a87-99ea-3faaf624a45d


geongeorge
PROOP

a year ago

I'm not very experienced with servers. lemme know if I'm just being paranoid for no reason


geongeorge
PROOP

a year ago

I have done everything I can to cache the api response and also added a redis cache


brody
EMPLOYEE

a year ago

  1. make sure all all your infrastructure is either on metal or not, the cross zone latency is a thing.

  2. if your services are on gcp then so should your edge network, if your services are on metal, then your edge network should also use metal (thunder bolt icon besides the domain)

  3. make sure the remix service has multiple replicas in multiple regions since node is limited to 1vcpu you need to horizontally scale instead.

  4. a database in multiple regions is overhyped, and extremely complex to setup, even if you are just doing read replicas, if anything you can do redis in multiple regions for regional cache.


geongeorge
PROOP

a year ago

@Brody Thank you!

  1. Metal does not have cross zone latency?

  2. Is Metal fully ready, I'm a little hessitant because I feel its recently released and this event is going to make or break our project

  3. If I have single postgres and multiple instance reading it wouldn't I hit a pool limit? I have had this issue before where postgres went un connectable on railway. You helped me at that time.?


brody
EMPLOYEE

a year ago

  1. i am referring to any gcp to metal zone - they are different datacenters so you do not want to mix and match

  2. metal stateless, yes, metal stateful, no

  3. postgres has a default max connection limit of 100, so if you stay under that i dont see any problems


geongeorge
PROOP

a year ago

If metal stateful is no, that means postgres on metal is no right?


brody
EMPLOYEE

a year ago

correct, its possible, but its beta


geongeorge
PROOP

a year ago

Question: What is an edge network?


brody
EMPLOYEE

a year ago

our global entrypoints for inbound traffic


geongeorge
PROOP

a year ago

How do I make sure "if your services are on gcp then so should your edge network,"?


brody
EMPLOYEE

a year ago

thunder bolt icon besides the domain, if its there then you are on the gcp edge network, if there is isntead a revert button, you are on the metal edge


geongeorge
PROOP

a year ago

Where should I be looking?

1349812744345489700
1349812744580235300


brody
EMPLOYEE

a year ago

hover your mouse over the doman


brody
EMPLOYEE

a year ago

!s


Status changed to Solved brody 11 months ago


Loading...