I’m trying to decide if I should be deploying my Hasura instances (and possibly Postgres read replicas) via fly or via AWS.
I’d personally prefer fly, but then I need to sort out how fly gets access to my AWS VPC where my RDS instance is running. Based on my research that seems like it’s via a Wireguard bastion host that I deploy in AWS.
Adding a hop like this seems like it would be a bottleneck (for both bandwidth and latency) as well as a single point of failure. But perhaps that’s not a problem in practice?
Does anyone here have real world experiences with a setup like this? How has it turned out?
This will work great in some AWS regions, and less great in others. In us-east-1, for example, it should work well because we’re <1ms away from AWS. In other regions latency is higher. The gateway is definitely another moving part to manage, though.
As much as I want you to use Fly for all the things, I would probably run Hasura on the same infrastructure as my database.
We’re trying to do the same, but I’m unable to connect my fly app to the ec2 peer… what ip / hostname are you using? My fly app → peer connection string looks something like:
My connect string looks like: postgres://USER:PASS@pgbouncer._peer.internal:6432/db_name. The pgbouncer name is based on the wireguard config that I setup for ec2 to use. I chose to use 6432 but I think the default would be 5432. I picked 6 to make it very clear that it’s not a normal postgres connection.
When you use wireguard, you’re effectively operating on a private network. So your app will never reference an IP or external DNS name.