I finally got around to trying to connect to it, just from my local dev so far. In NixOS, I’ve set cacertfile to /etc/ssl/certs/ca-certificates.crt.
A couple of gotchas I found:
If a PGHOST environment variable is set, as it is in my project’s Devbox environment, that will be used over what’s in Ecto’s Repo config. So I ran mix ecto commands with: PGHOST="" mix ecto.migrations
(Of course, the environment wouldn’t usually have PGHOST set to something other than Neon if it’s Neon that’s in use, but I just wanted to temporarily experiment.)
If Neon has suspended compute after a few minutes of inactivity, the connection for the mix ecto command results in ** (DBConnection.ConnectionError) connection not available and request was dropped from queue after 2987ms. Simply running the command again works for me.
I’d like to look at using Neon’s branching for a staging envrionment and to enable easy backups and recovery of lost data in the event of an issue with production.
Oh that’s a great idea having a staging branch with them.
I’m not using it for that personally but I like that idea.
I had tried fly’s postgres but got a little nervous seeing a few issues in the community forms. Had they had a way to easily have automated offsite backups to R2 or S3 or something probably would not have tried Neon. But having Neon with branching and point in time recovery and autoscaling is pretty nice.
Main downside is scale to zero takes a second to boot up again. I don’t think it’s a bad thing to have if your app has heavy traffic… but mine doesn’t so there’s sometimes a bit of a lag. But I think it’s still early days for them and they’ll only get faster.