I followed the setup guide here but it yields a few issues:
Issue 1: persisting a volume
- If we persist the volume, only one machine can mount it and there doesn’t seem to be a supported way for multiple machines to safely write to the same hard disk for things like cache.
- If we persist a volume, there doesn’t appear to be a way to run deploy scripts since Fly start scripts don’t have volume access when they run. Any application needs to run
php artisan optimize
on deploy and there doesn’t appear to be a way to do this without SSHing in every time and running it manually in the console.
It seems to me that the Fly documentation for Laravel probably should say that you can only use one machine unless you use additional servers for everything else, which I’m totally fine with and it makes sense to do so. If we follow that path, it makes sense that if we stay within the Fly system, we need to create a Redis and Postgres machine, and use a 3rd party storage service like S3 or Tigris. Assuming we’ve done that and that Redis will handle queues and cache, here’s the remaining issues that I’m not confident are handled out the gates:
Issue 2: How do we persist laravel logs?
Issue 3: How do we prevent the laravel scheduler (Laravel jobs that run at the same time every day) from running multiple times on the multiple machines?
Issue 4: How does the queue work with multiple machines? Does Redis automatically distribute between the machines and there’s no risk of double-running?
Issue 5: Any other considerations or concerns that we should have running multiple machines?