I’ve just learned about Fly and find it to be an interesting service. As best I can tell, the primary selling point is that an app can automatically scale and move between regions so it is always running close to its users. I can see why this is awesome for stateless services, but it has me wondering about stateful apps that primarily keep data in memory (ie. Elixir). To that end, I have a few questions:
Question 1: Is this an obviously bad use case for Fly? I’m sure there are work arounds like sending data to Redis or disk on shutdown, but it’s always best to not need such work arounds in my opinion.
For the sake of discussion, let’s assume:
- I have a perfect app, it never crashes, never runs out of memory, and would never shutdown or restart due to its own fault.
- The app has one instance, is configured only in a single region, and has no autoscaling (min=1 max=1).
Question 2: How long should the VM stay running? Are we talking minutes, hours, days, or indefinitely? Is it ever shut down due to low traffic?
Question 3: Now let’s assume the same app is configured with two possible regions, but still a maximum of one instance. Is it safe to assume that Fly might shutdown the VM at any time and move it to another region depending on where requests are coming from?
Thank you for any insight you can share.