Hey all,
I’m having some issues with my database deployed on Fly.io. I’m trying to setup auto start/stop on my application to save on costs during downtime. Its a live streaming application so has quite heavy usage between long periods of inactivity, so auto stop/start would be perfect. I have created the app with fly launch and the database app is created using fly postgres create and attaching to the main app. The app and database connection works fine when the database is already up.
Both my app and app-db are stopping correctly, my app is starting correctly too however when the application connects to the database string only the replica machine in the primary region starts, this replica machine’s volume does not appear to have any of my tables and so the main application fails.
If i reduce the app-db to only one machine in the primary region then auto start/stop works fine as expected.
I have two questions really:
- How do i both ensure that my application connects to the correct machine , if thats even a consideration i need to make.
- How do i ensure that my replica is up to date with my primary database volume and writes in my application update all the volumes?
Many thanks!
Tom.