I think there are 2 concerns here.
- Sharing data across app. Can the LiteFS db sync across app boundaries.
- How does LiteFS handle multiple databases on Fly.io.
Item 1 - Sharing Data Across Apps
I know you can have multiple apps share the same database (backend / frontend).
I have a use case where I have a BaaS app that is the Primary.
The UI is then separate apps that can scale horizontally, and are read only.
In this case I share the LiteFS Cloud key, and the Consule key. I make sure the Consule setup uses the same app name for both.
Item 2 - Handling Multiple Databases
I asked a similar question here, and the answer made it sound like the proxy only knows about one database.
That being said, I have a static lease setup locally, and using NGINX where I control where POST requests go. The way I understand it, is that Fly.io proxy only knows of one database when using Consul.
With a static lease, I am not sure you have the option to use the fly proxy, as you are defining the endpoint as static. But your apps need to know “where” to write. This goes for all databases. This model can have downtime, manual intervention, and won’t handle scaling horizontally.
BUT -
The LiteFS example repo uses NGINX to route all non-get requests to the right place. I think you could use this on fly.io to handle something similar, but making the proxy handle multiple databases for you.
Hope that helps, really curious the outcome with your work here.
One final thought - When I go to interact with LiteFS Cloud, I do have to select a database (not just the cloud instance), which makes the UI feel like it supports multiple. It’s possible that it would backup all DBs, but not 100% clear on this, and have not found a direct question/answer around the cloud specifically.
Though it sounds like they may cap at 10GBs for the Cloud instance backup. Not sure if your 100 DBs go beyond that. But you can always just backup to S3 or B2 or some other S3 compatible storage pretty easy with Litestream (also made by @benbjohnson)