Hi everyone. I am deplying an app that is basically read only on a database with daily updates of a few records. I would like to able to have a replica of the database on my local machinehere and make it the primary so i can add the records.
Is this possible? seems like everything happens automagically inside fly by using the in built consul.
You can use a static lease with LiteFS instead of Consul, however, it might be tricky getting your deployed app to connect to your local machine. But if you can get that working with something like ngrok then you could keep the SQLite database on your local machine and your deployed machine could fetch updates from there.
The static lease config on your local computer would look like:
You’ll need to figure out a way to secure LiteFS though. It assumes you’re running on a private network so there’s no built-in auth. Maybe some kind of ssh port forwarding would work instead?