Read-only replica for Postgres

Hello! I would like to add a read-only postgres replica who can never become a leader.
We want to perform analytics queries on it without overloading our “live replicas”.

Any guidance on how to do this on fly?

The way Postgres is configured, replicas in a secondary region are ready only, they won’t become primary. Running a read replica in the primary region would take a little bit of work on our Postgres app: GitHub - fly-apps/postgres-ha: Postgres + Stolon for HA clusters as Fly apps.

Do you need a live replica or will restoring a backup to a new Postgres work? You can list snapshots by running:

fly volumes list
fly volumes snapshots list <volume_id>

And then restore one to a new postgres with:

fly pg create --snapshot-id <id>
1 Like