Does my app have to be in the same region as my postgres cluster?

The answer to my title I assume should be no right? I deployed my postgres cluster to sjc (no replicas yet other than what was created by the production template). My app has sjc as the primary region but lax and sea as backup regions. For some reason I’ve noticed that whenever the app deploys in lax or sea, I get this error: Can't reach database server attop2.nearest.of.my-cluster.internal:5433, however if I deploy directly to sjc it works fine.

Port 5433 should only be used for connecting to read-only replicas. Can you try on port 5432? One thing to consider is that connecting to Postgres from other regions will add some latency.

Yeah, even when I use port 5432, same issue happens. I have the cluster in sjc, I moved my app to lax, and I get this error: django.db.utils.OperationalError: could not translate host name "top2.nearest.of.ludicrous-bravo.internal" to address: Name or service not known

Is it better now? The emergency migration we did last Friday in LAX seemed to have broken the configuration of one of the hosts, your app might’ve been running on it.

I see DNS returning the right response from all our hosts right now.

Yep, that fixed it!

1 Like